-
-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Store works when using "window.localStorage" but not when using "localForage".. any pointers would be appreciated #232
Comments
Hi All, So I have been able to work out how to get around the However, if I want to specify modules, the docs say you shouldnt use a reducer. Any idea if it is possible to apply a reducer per module? Or a fix so that state is stripped of all non-cloneable entries before being passed to localforage? Here is what I have working atm, however I would like to be able to have Any suggestions?
For example, if I try this, I get a complete copy of all store modules in both databases.
and modify
Many thanks in advance. |
I am having the same issue. No idea what may be going on there… also not really much to add, the description is already pretty on point. |
I think we can do something like this: storage: {
getItem: async (key: string) => {
const raw: string | null = await localForage.getItem(key)
const data = raw ? JSON.parse(raw) : {}
return data
},
setItem: async (key: string, value: any) => {
const valueString = JSON.stringify(value)
localForage.setItem(key, valueString)
},
removeItem: async (key: string) => localForage.removeItem(key),
},
asyncStorage: true, aka. wrap the This way we can still use the modules as well. |
Hi All,
New to "vuex-persist" mainly been using another persist package, and started having issues with exceeding storage size.
Data is around 6mb, but looks like LocalStore is limited to less than ~5Mb.
So thought I would take a look into using "vuex-persist" and IndexedDB (via localForage).
As such, I have configured my store as follows:
When run the above, all works as expected, I can see the localStore "data" key created with content, and when refreshing the page, everything loads as expected.
However, if I change to "localForage", nothing shows up in the "IndexedDB" Browser and when page is refreshed all data is lost.
PS: I do find I am getting the following on both Firefox and Chrome:
Which is weird, as all the data is a bunch of large arrays, and localStore saves perfectly.
Any suggestions or pointers would be really appreciated.
Many thanks in advance.
Package Versions:
The text was updated successfully, but these errors were encountered: