-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
504 additions
and
316 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "all", | ||
"semi": false | ||
"semi": false, | ||
"printWidth": 100 | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
computed atoms are like implicit atoms but reverse | ||
computed atoms are not copied | ||
reverseImplicitSet is a set of computed atoms to indicate whether a computed atom should be treated as a reverse implicit | ||
the atom is removed from the set between recomputations | ||
by intercepting the readFn, if an atom is `get` that is either an explicit or reverse implicit, | ||
|
||
- then the atom is added to the reverse implicit set | ||
|
||
only the readFn determines if the atom is added to the reverse implicit set | ||
intercepting the readFn and writeFn is used to get the "correct" atom | ||
when a computed atom converts to reverse implicit, | ||
|
||
- its atomState is copied from the unscoped atomState | ||
- this is because the atomState stores a different value for the scoped atom and can have different dependencies | ||
|
||
**Special Case:** on first read, when a computed atom reads a scoped atom, | ||
|
||
1. it is added to the reverse implicit set | ||
1. the atomState is copied from the unscoped atomState | ||
1. getAtomState points to the scoped atomState | ||
|
||
the atomStateProxy is no longer needed. | ||
|
||
# Implementation | ||
|
||
readAtomTrap: | ||
getter: |
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.