quarrant / mobx-persist-store

Persist and rehydrate observable properties in mobx store.
268 stars 14 forks source link

configurePersistable initialization failed? #114

Open momtboy opened 8 months ago

momtboy commented 8 months ago

index.ts:8 mobx-persist-store: GlobalStore does not have a valid storage adaptor.

momtboy commented 8 months ago

configurePersistable({ storage: window.localStorage, debugMode: true, })

quarrant commented 8 months ago

Hello! I think you need something like this https://github.com/quarrant/mobx-persist-store/issues/91

codeBelt commented 8 months ago

@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.

codeBelt commented 8 months ago

@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, })