forked from facebookexperimental/Recoil
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Snapshot.getInfo() for Dev Tools (facebookexperimental#504)
Summary: Pull Request resolved: facebookexperimental#504 Add a `getInfo_UNSTABLE()` method to `Snapshot` to "peek" the current status of a node. It returns a structure with the following: ``` function getInfo_UNSTABLE(RecoilValue): { loadable: ?Loadable<T>, isActive: boolean, isSet: boolean, isModified: boolean, type: 'atom' | 'selector' | void, deps: Iterable<RecoilValue<mixed>>, subscribers: { nodes: Iterable<RecoilValue<mixed>>, }, } ``` This API could replace both `getDeps()` and `getSubscribers()` if we decide we prefer this approach. There is a semantic difference that this only "peeks" the state and will not evaluate selectors that have not already been evaluated or change the snapshot in any way, unlike the current `getDeps()`. Based on needs for dev tools we can decide if we prefer this or change it to `getStatus()` and hopefully remove the other... Reviewed By: maxijb, davidmccabe Differential Revision: D22204282 fbshipit-source-id: a6012ed81db476c74241ffaffae961ec96742836
- Loading branch information
1 parent
f8f6b4b
commit f77ddc9
Showing
9 changed files
with
320 additions
and
27 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
Oops, something went wrong.