Recoil has functionality to allow you to observe and update state changes.
This API is currently under development and will change. Please stay tuned...
Once you have a
Snapshot, you can use methods such as
getInfo_UNSTABLE() to inspect the state and use
getNodes_UNSTABLE() to iterate over the set of known atoms.
useGotoRecoilSnapshot() hook can be used to update the entire Recoil state to match the provided
Snapshot. This example maintains a history of state changes with the ability to go back and restore previous global state.
Snapshot's also provide a
getID() method. That can be used, for example, to help determine if you are reverting to a previous known state to avoid updating your snapshot history.