Skip to content

is there anyway I can remove an atomFamily all items? #1121

Answered by dai-shi
lili21 asked this question in Ideas
Discussion options

You must be logged in to vote

Because .setShouldRemove() will run once immediately, you can do this:

listDataAtom.setShouldRemove(() => true); // set function to remove all
listDataAtom.setShouldRemove(null); // clear function

Replies: 2 comments 3 replies

Comment options

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

Answer selected by lili21
Comment options

You must be logged in to vote
2 replies
@dai-shi
Comment options

@ryym
Comment options

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