-
Notifications
You must be signed in to change notification settings - Fork 668
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
Override component watcher with mounting options #1392
Conversation
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.
I thought there might be alternate data structures for watch
... Based on the examples here, we need to support: Strings, Functions, Arrays, Objects.
Does includes
work as desired with all of those data types?
Jess, the key is always a string :) |
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!
Quick question: what would happen if the instance
watcher is immediately invoked but the component
one isn't (or the other way around)? Would this logic override the value from the instance
watcher no matter what?
The one you pass to the mount should always override the entire watcher definition, imho. Its up to you, as a dev to take care if its immediate, deep or whatever, no? |
Sure! I guess what I wanted to confirm is that the current implementation overrides the entire definion, not only the |
resolves #1391 . We should override a component's watcher if one is provided in the mounting options. The issue explains the bug a bit better and provides an example.