Globally subscribe to actions #1037
-
Trying to subscribe to any action call from any store. Use case: Logging for automated error reports (store action history: very useful information). While Vuex had a global pinia.use({ store } => {
store.$onAction({ name, args } => /* do things */) And this works, but when in combination with Vue Router and Options API, this yields in Edit: If this is unexpected / a bug, please tell me so I can fiddle together a repro repo, but I'd prefer not to as it is a complex setup that needs a lot of narrowing down |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Using a plugin is the correct way due to having multiple stores in Pinia. the |
Beta Was this translation helpful? Give feedback.
Using a plugin is the correct way due to having multiple stores in Pinia.
the
onMounted()
warning cannot come from pinia as it doesn't have any occurrence in its code