dai-shi / redux-in-worker

Entire Redux in Web Worker
https://www.npmjs.com/package/redux-in-worker
MIT License
260 stars 6 forks source link

How to use redux-persist #37

Open Roshdy opened 1 year ago

Roshdy commented 1 year ago

Hello, I tried to add redux-persist with no luck.

I tried in App.js

const store = wrapStore(new Worker(new URL('./store.worker', import.meta.url)), {});
const persistor = persistStore(store);

but i get the error: Failed to execute 'postMessage' on 'Worker': function register(key)

When I tried to trace it, sadly I couldn't figure out anything

Any help would be great!

dai-shi commented 1 year ago

I think it would be desirable to persist state in the worker. Though, I'm not sure if it's possible.

Roshdy commented 1 year ago

hmmm. I guess I'll have to go Vanilla on that one!

Thanks for your reply.