Closed dimavolo closed 3 years ago
Hey.
Should do, but this sounds like an issue with Vuex Persist rather than Pathify.
All Pathify does is the wiring to your store, along with some clever "reaching into" properties if you use make.mutations()
and sub@properties
.
If you remove Vuex Pathify does the other library magically work?
Closing because no reply.
I found some really weird and abnormal behaviour when using vuex-pathify with vuex-persistedstate.
For example if I push something into an array like this this.myPathifyKey.push(someElement)
then it will be registered (persisted) by vuex-persistedstate only if it's done in some places, such as in a mounted hook of a component, while if I do the exact same thing inside an event listener for example, then it will not be persisted.
But, if I do this instead this.$store.set('pathifyModule/myPathifyKey', ...myArray)
Then it will be persisted ? Go figure.. could not understand why it's failing in the first instance.
I've initialized vuex-persist in the standard way:
I have two typical vuex modules: [user, nav]
I'm finding that instead of persisting
user.user.firstName
, it is persisting it asuser.firstName
(i.e. one level up).Does pathify normally work with
vuex-persist
and typical vuex modules out of the box, or is there some configuration required?Thanks!
Update I found that if I changeSpoke too soon.user.user
to a unique sub-key name, likeuser.userData
, then it all works as expected.