-
Notifications
You must be signed in to change notification settings - Fork 344
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
feat: improve reactive checks #502
feat: improve reactive checks #502
Conversation
}, | ||
}) | ||
} | ||
// TODO way to track new array items |
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.
Should we hijack the array methods or just leave a caveat in the readme?
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.
Is quite interesting idea, just thinking we might need to listen to other "events" to keep it consistent, for example, if you assign an array to an object, are we hijacking that 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.
What do you mean "events"? If I recall correctly, Vue 2 hijacked the array's push/unshift, etc to achieve the reactivity updates.
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.
when you add a new property to an object or when you change the property of the obj to an 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.
Oh, I see, I got what you mean. And yeah, if we handle the hijacking here and wrap the value with markReactive
for newly added properties, they should be well covered I think.
Instead of changing
reactive
object we just use a weak set to keep track on what objects are reactiveThis allows to have
arrays
asreactive
, bringing it closer to vue 3Still need to:
Close #501, close #219