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
+14-1Lines changed: 14 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -233,7 +233,20 @@ const store = new Vuex.Store({ ...options })
233
233
})
234
234
```
235
235
236
-
Most commonly used in plugins. [Details](../guide/plugins.md)
236
+
> New in 3.4.0
237
+
238
+
Since 3.4.0, `subscribeAction` can also specify an `error` handler to catch an error thrown when an action is dispatched. The function will receive an `error` object as the third argument.
239
+
240
+
``` js
241
+
store.subscribeAction({
242
+
error: (action, state, error) => {
243
+
console.log(`error action ${action.type}`)
244
+
console.error(error)
245
+
}
246
+
})
247
+
```
248
+
249
+
The `subscribeAction` method is most commonly used in plugins. [Details](../guide/plugins.md)
0 commit comments