-
Sorry I have no clue about this. Say I'm creating an atom for a new item and i have an object that maps ids to atoms:
If somewhere in my app i delete the item with the id of 10, i want to get rid of its atom too to prevent a memory leak. How? My app will potentially have thousands of atoms and just imagine the memory leaks if i don't remove these atoms when their associated item is removed. |
Beta Was this translation helpful? Give feedback.
Answered by
dai-shi
May 30, 2024
Replies: 1 comment 1 reply
-
Think of Jotai store being just a WeakMap (and it actually is, except for tracking "mounted" atoms). |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
rafark
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
delete items['10']
.Think of Jotai store being just a WeakMap (and it actually is, except for tracking "mounted" atoms).