Skip to content
This repository has been archived by the owner on Jan 1, 2025. It is now read-only.

Asynchronous initial state with synchronous default? #1189

Answered by drarmstr
dqii asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, if you initialize atom state with Atom Effects you can either initialize with a promise so it starts in a pending state, or you can use this pattern to have it start with the default value and when the data is asynchronously ready then update the atom value.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dqii
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants