forked from HubSpot/general-store
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoids duplicate deref calculations in
useStoreDependency
See HubSpot#95 Avoids duplicate deref calculations in `useStoreDependency`. Only calculate once; use this result to initialize state (if necessary) and as the next state. When the value changes, two deref calculations will still run: 1. the initial render/hook call 2. the re-render/hook call triggered by setting the new value in state
- Loading branch information
1 parent
5569034
commit d963af0
Showing
2 changed files
with
38 additions
and
4 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