Closed jerometremblay closed 7 years ago
@jerometremblay could you try to implement the get / set methods yourself instead of just passing the localForage instance? See the fiddle here => https://jsfiddle.net/robinvdvleuten/meoLa716/
@jerometremblay as you can read in the localForage documentation their getters and setters work with promises or callbacks. The storage instance passed to the vuex-persistatedstate plugin must be synchronous handling these getters and setters.
@robinvdvleuten so there is no way to use localforage with vuex-persistedstate
? I can't use sessionstorage/localstorage/cookies because I need to store data more than 10MB
@robinvdvleuten Sorry for digging up an old thread but I'm quite interested. giro-varghese asked if it is impossible to use localforage with vuex-persistedstate. I would much appreciate your estimate on any reasons why this could not work. Because if it is possible, in a sense that it is technologically compatible without hacking, I might give it a go. I'm at a point where I should be able to write such a plugin but unable to judge if it is 'right' to do so.
@zwarag as I explained in my comment above, the getters and setters of this plugin are synchronous and localForage uses asynchronous getters and setters. There is no way to make the getters / setters of this plugin async because they rely on the synchronous handling of state by Vuex.
@robinvdvleuten Thank you for the great work. I am just a bit confused as to why it won't work? Isn't this the exact scenario where async / await should do the trick?
Looking forward to your response.
I configured vuex-persistedstate two different ways:
Thank you