You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reactively watch a getter function's return value, and call the callback when the value changes. The getter receives the store's state as the first argument, and getters as the second argument. Accepts an optional options object that takes the same options as Vue's `vm.$watch` method.
145
+
Reactively watch `fn`'s return value, and call the callback when the value changes. `fn` receives the store's state as the first argument, and getters as the second argument. Accepts an optional options object that takes the same options as Vue's `vm.$watch` method.
146
146
147
-
To stop watching, call the returned handle function.
147
+
To stop watching, call the returned unwatch function.
148
148
149
-
- **`subscribe(handler:Function)`**
149
+
- **`subscribe(handler:Function):Function`**
150
150
151
151
Subscribe to store mutations. The `handler` is called after every mutation and receives the mutation descriptor and post-mutation state as arguments:
152
152
@@ -157,9 +157,11 @@ const store = new Vuex.Store({ ...options })
157
157
})
158
158
```
159
159
160
+
To stop subscribing, call the returned unsubscribe function.
161
+
160
162
Most commonly used in plugins. [Details](plugins.md)
0 commit comments