forked from facebookexperimental/Recoil
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
useRecoilCallback() snapshot gets the latest state (facebookexperimen…
…tal#1610) Summary: Pull Request resolved: facebookexperimental#1610 NOTE: This is a breaking change, but the previous approach had a bug. Previously, `useRecoilCallback()` would attempt to provide a `Snapshot` based on the state that was currently rendered. However, there were some bugs where this was not the case. For example, a callback called from an effect handler may or may not have had the latest rendered state based on the timing of the setter. The new approach `useRecoilCallback()` will always try to get a snapshot with the latest state. This should also be more intuitive for users. Addresses facebookexperimental#1604 Reviewed By: habond Differential Revision: D34236485 fbshipit-source-id: fc10621f4569bff753c1755b4c2e41601d6b8069
- Loading branch information
1 parent
4b985a3
commit 062de4c
Showing
7 changed files
with
83 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters