Skip to content

write atom on async atom? #585

Closed Answered by dai-shi
prrrcl asked this question in Q&A
Jul 8, 2021 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

It's prohibited to write a value directly to a derived atom. (because it may cause inconsistencies.)

This pattern is implemented as atomWithDefault in jotai/utils. You could also do the similar way on your end.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@prrrcl
Comment options

@dai-shi
Comment options

@tukaz
Comment options

Answer selected by prrrcl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants