Skip to content

Style: update variable name #7755

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

Merged
merged 1 commit into from
Mar 8, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/core/instance/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ function initWatch (vm: Component, watch: Object) {

function createWatcher (
vm: Component,
keyOrFn: string | Function,
expOrFn: string | Function,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's key path or function, IMO keyOrFn is better :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but it's using

return createWatcher(vm, expOrFn, cb, options)

should we change expOrFn to keyOrFn, I just get confused when reading the code, exactly the same thing but using different name.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops...you are right, it is expOrFn indeed.😂

handler: any,
options?: Object
) {
Expand All @@ -303,7 +303,7 @@ function createWatcher (
if (typeof handler === 'string') {
handler = vm[handler]
}
return vm.$watch(keyOrFn, handler, options)
return vm.$watch(expOrFn, handler, options)
}

export function stateMixin (Vue: Class<Component>) {
Expand Down