Skip to content

Fix local watcher example#93

Open
Glandos wants to merge 2 commits intomichaelolof:masterfrom
Glandos:patch-1
Open

Fix local watcher example#93
Glandos wants to merge 2 commits intomichaelolof:masterfrom
Glandos:patch-1

Conversation

@Glandos
Copy link

@Glandos Glandos commented Mar 18, 2021

If the $watch is not static, then it is part of the object constructor in TypeScript and not part of the object prototype, so it can't be accessed from createLocalWatchers.

Glandos added 2 commits March 18, 2021 15:49
If the `$watch` is not static, then it is part of the object constructor in TypeScript and not part of the object prototype, so it can't be accessed from [`createLocalWatchers`](https://github.com/michaelolof/vuex-class-component/blob/master/src/proxy.ts#L222).
Since the watcher is called with the class instance as `this`, tell TypeScript to use it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant