-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement reactive variables for tracking local state. (#5799)
Local variables are functions that allow you to store local state in a well-known, private location, an update it whenever you like: const lv = cache.makeLocalVar(123) console.log(lv()) // 123 console.log(lv(lv() + 1)) // 124 console.log(lv()) // 124 lv("asdf") // type error Any parts of any queries that relied upon the value of the variable will be invalidated when/if the variable's value is updated.
- Loading branch information
Showing
3 changed files
with
136 additions
and
1 deletion.
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