Skip to content

How to make an atom's default value relies on RecoilValue's evaluated value #1711

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

You must be logged in to vote

If you want the search to only be initiated from actions instead of staying in sync with all upstream atom changes then you could split your parameter state to separate atoms. A "pending" atom that is updated as you edit and then transferred to a "submitted" when the search button is clicked.

It looks like you're mostly doing this. However, the "submitted" atom shouldn't get the default parameters at all if the intention is to avoid any searches until the button is clicked.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by wendyzhaogogo
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
Converted from issue

This discussion was converted from issue #1689 on April 02, 2022 07:25.