$subscribe miss mutations when working with multiple Stores #1661
Unanswered
aabm00
asked this question in
Help and Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi !!
I have created a plugin for subscribing to all the Stores State and when the state change it's saved to indexedDB
The plugin is:
With this plugin registered as
pinia.use(IndexedDbPlugin);
it is assumed that when each Store changes its state, it should be stored in indexedDB.It works fine when I make changes in a single Store but when for example simultaneous changes are made in 2 Stores it only updates one.
For example I have 2 Stores (ProjectStore and GoalStore) and when I create a Goal in a project it is created in GoalStore and added to ProjectStore.
These operations are performed from GoalStore:
So, when the createItem method is called:
The problem is that only the state of ProjectStore is updated in indexedDB and not the state of GoalStore when $subscribe should work for both.
Am I omitting some important detail?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions