mobx-persist-store icon indicating copy to clipboard operation
mobx-persist-store copied to clipboard

configurePersistable initialization failed?

Open momtboy opened this issue 1 year ago • 4 comments

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

momtboy avatar Jan 10 '24 06:01 momtboy

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

momtboy avatar Jan 10 '24 06:01 momtboy

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

quarrant avatar Jan 10 '24 08:01 quarrant

@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 avatar Jan 10 '24 17:01 codeBelt

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

codeBelt avatar Jan 10 '24 17:01 codeBelt