mobx-persist-store
mobx-persist-store copied to clipboard
configurePersistable initialization failed?
index.ts:8 mobx-persist-store: GlobalStore does not have a valid storage adaptor.
- Make sure the storage controller has 'getItem', 'setItem' and 'removeItem' methods."
configurePersistable({ storage: window.localStorage, debugMode: true, })
Hello! I think you need something like this https://github.com/quarrant/mobx-persist-store/issues/91
@quarrant we might want to remove the invalidStorageAdaptorWarningIf
check because storage: window.localStorage
should be fine. In the Demo we use window.localStorage
.
I don't think that util check is accurate.
@momtboy It's has been awhile but if you are using storage: window.localStorage
I think you also need to set stringify: true
. I could be wrong.
configurePersistable({ storage: window.localStorage, stringify: true, debugMode: true, })