-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CLEANUP beta] Abstract chainWatchers into an object. #11819
Conversation
@krisselden is green! |
}, | ||
|
||
revalidateAll() { | ||
for (let key in this.nodes) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we ever delete from this.nodes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, we just empty the array
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stefanpenner should it just search a single array or linked list of well shaped entries? like {key: 'foo', node: node} ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
array should be good, as we just do a sequential scan anyways.
@krisselden whats blocking this/ |
// a map of nodes that reference a key | ||
function ChainWatchers(src) { | ||
this.src = src; | ||
this.nodes = Object.create(null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function Empty() {}
Empty.prototype = Object.create(null);
...
this.nodes = new Empty();
4c2cc1f
to
95d3f3f
Compare
95d3f3f
to
2f63cab
Compare
@stefanpenner rebased and squashed |
[CLEANUP beta] Abstract chainWatchers into an object.
Abstracting chainWatchers into an Object, cleans up some shape deopts, helps make stuff more clear. This is good to go, I haven't squashed yet just so it is easier for people to review updates.