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/ru/api/README.md
+14-1Lines changed: 14 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -233,7 +233,20 @@ store.subscribeAction({
233
233
})
234
234
```
235
235
236
-
Чаще всего используется в плагинах. [Подробнее](../guide/plugins.md)
236
+
> Добавлено в версии 3.4.0
237
+
238
+
С версии 3.4.0 в `subscribeAction` также можно указывать обработчик `error` для перехвата ошибки, выброшенной при выполнении действия. В качестве третьего аргумента функция получает объект `error`.
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
+
Метод `subscribeAction` чаще всего используется в плагинах. [Подробнее](../guide/plugins.md)
0 commit comments