-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add support for the ownKeys
trap
#26
Conversation
Size Change: +343 B (+6%) 🔍 Total Size: 6.1 kB
|
@DAreRodz, sorry to bother you again, but if you could take a look here, it would be fantastic. Many thanks 🙂 |
Congratulations! Looks much more elegant than my quick hack from yesterday! However: would you ming adding support for |
Can you open another issue for that and explain the use cases, etc? Thanks! |
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.
LGTM! 👍 It's no bother at all, @luisherranz. 😄
What
Add support for the
ownKeys
trap, which is used withfor..in
,getOwnPropertyNames
orObject.keys/values/entries
.RevertDeepSignal
type which is useful when usingObject.values()
.array.length
and we were already updating that signal when items are added or removed from the array.Why
To be able to subscribe when properties are added or removed from objects.
How
I added a new map that stores a fake signal for each object. When
ownKeys
is accessed, the computations are subscribed to that signal. When a property is added or removed from the object, we update the signal to retrigger the subscribed computations.