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
Copy file name to clipboardExpand all lines: docs/api/README.md
+16-1Lines changed: 16 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -120,7 +120,7 @@ const store = new Vuex.Store({ ...options })
120
120
121
121
- type: `Boolean`
122
122
123
-
Turn the devtools on or off for a particular vuex instance. For instance passing false tells the Vuex store to not subscribe to devtools plugin. Useful for if you have multiple stores on a single page.
123
+
Turn the devtools on or off for a particular vuex instance. For instance passing false tells the Vuex store to not subscribe to devtools plugin. Useful for if you have multiple stores on a single page.
124
124
125
125
``` js
126
126
{
@@ -207,6 +207,21 @@ const store = new Vuex.Store({ ...options })
207
207
208
208
To stop subscribing, call the returned unsubscribe function.
209
209
210
+
> New in 3.1.0
211
+
212
+
Since 3.1.0, `subscribeAction` can also specify whether the subscribe handler should be called *before* or *after* an action dispatch (the default behavior is *before*):
213
+
214
+
``` js
215
+
store.subscribeAction({
216
+
before: (action, state) => {
217
+
console.log(`before action ${action.type}`)
218
+
},
219
+
after: (action, state) => {
220
+
console.log(`after action ${action.type}`)
221
+
}
222
+
})
223
+
```
224
+
210
225
Most commonly used in plugins. [Details](../guide/plugins.md)
0 commit comments