Skip to content

atomFamily that auto cleans up atoms no longer in use #2775

Answered by dmaskasky
jvliwanag asked this question in Ideas
Discussion options

You must be logged in to vote

This would totally work and I actually wrote this code before.

But it has a huge problem. What if an atom gets dereferenced too early? Then the next time you call fooFamily(3), you will get a new atom and the previous state would be lost.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jvliwanag
Comment options

Answer selected by jvliwanag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants