Vuex: The wording of Store.watch in API reference is confusable

Created on 23 Jan 2018  路  2Comments  路  Source: vuejs/vuex

Version

3.0.1

Reproduction link

https://jsfiddle.net/50wL7mdz/92559/

Steps to reproduce

Attempt to use store.watch with a getter (store.getters.GETTER_HERE) as explained in docs, and shown in reproduction.

What is expected?

Handler to be called when variable updated.

What is actually happening?

Uncaught Error: [vuex] store.watch only accepts a function.

documentation

Most helpful comment

It actually should be a function but not a real getter. I guess it is written as so because the users have function form getters in Vuex 1.x. We need update the wording to avoid confusion.

All 2 comments

To see error in reproduction uncomment L18-L21

It actually should be a function but not a real getter. I guess it is written as so because the users have function form getters in Vuex 1.x. We need update the wording to avoid confusion.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gorbypark picture gorbypark  路  3Comments

Nickvda picture Nickvda  路  3Comments

niallobrien picture niallobrien  路  3Comments

weepy picture weepy  路  3Comments

james-wasson picture james-wasson  路  3Comments