]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commit
fix: allow using multiple `$onAction`, **ignore returned value**
authorEduardo San Martin Morote <posva13@gmail.com>
Mon, 13 Dec 2021 10:06:43 +0000 (11:06 +0100)
committerEduardo San Martin Morote <posva13@gmail.com>
Mon, 13 Dec 2021 10:06:43 +0000 (11:06 +0100)
commit4dc1f1bec8f3db508c02fa6bdcc8203f280cbb3e
tree911f6a565579c970a76d983dcf7b979dde481edb
parent920e686221a8b7a6a780e8dbc31017808377fa1b
fix: allow using multiple `$onAction`, **ignore returned value**

Fix #893

This change removes the ability to return `false` to avoid an action to
throw because differently from `onErrorCaptured` from Vue 3, errors are
not propagated here and this behavior could lead to actions not throwing
inside components, which is is rather error-prone. This behavior can
still be achieved with a plugin that override every action in a store.
It also removes the ability to override the returned value with `after`,
which was error prone for the same arguments. Fortunately, these were
**undocumented features**, and should not be used. Revisitting the old
implementation could be revisited but should go through an RFC to
discuss different possibilities (e.g. should the returned value inside
`after` be passed to any other `after`?) to find the most one that makes
more sense for a default.
packages/pinia/__tests__/actions.spec.ts
packages/pinia/__tests__/onAction.spec.ts
packages/pinia/src/store.ts