-
Notifications
You must be signed in to change notification settings - Fork 865
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
Implementation of redux-persist with react-boilerplate #815
Comments
Yeah, I'm struggling with this as well. I think it has something to do with ImmutableJS. In previous |
Any updates on this issue I am facing the same issue. any solution? |
@Farrukhameen ended up using version 4. At least it works as expected. |
I implemented redux persist with this: https://egghead.io/lessons/javascript-redux-persisting-the-state-to-the-local-storage |
@Gyvastis version 4 of redux-persist or what ? |
@sincerekamal version 4 of redux-persist works with react-boilerplate |
Is there any documentation for that specifically ? because I failed to do it correctly. It would be great to just integrating this into |
For my build
Relevant code in import { persistStore, autoRehydrate } from 'redux-persist-immutable';
import localForage from 'localforage';
// ...
const enhancers = [
applyMiddleware(...middlewares),
autoRehydrate(),
];
// ...
const store = createStore(
createReducer(),
fromJS(initialState),
composeEnhancers(...enhancers)
);
window.persistor = persistStore(store, { storage: localForage, whitelist: [/*app-specific keys*/] }, (a, b) => {
console.log('Redux-Persist loaded state');
});
store.runSaga = sagaMiddleware.run;
store.injectedReducers = {};
store.injectedSagas = {};
// ... I have more related code but its app-specific. That should be enough to get it working. EDIT: I assign it to |
obviously you use also https://www.npmjs.com/package/localforage. Anyway I´m new to react/redux and don´t see how to merge this with https://www.npmjs.com/package/redux-persist. The docu on https://www.npmjs.com/package/redux-persist-immutable says it`s a wrapper so some of the original redux-persist need still to be applied, but seams to be incompatible. For eg:
I´m also not sure weather or not once can use the window.persistor like that:
When it try this I get the exception:
and I´m not the only one: #731 |
localforage was my choice for storage engine yes, but any of the options from the docs can be used. Redux Persist 5 is a mess. The majority of issues on this repo were created after the release of v5. And no real commits addressing issues have been made since at least June 2018. I tried migrating to v5 on release it was never worked. I would suggest you stick to the version I mentioned in my comment unless there is something specific you need with v5. |
you are damn right its a mess, just look at this: #64 |
Thx! |
It is a mess. If anybody wants to help with development, bug fixes, or organizing the issues, help would surely be very welcome. I'm trying to at least organize and prioritize the issues with labels, and work through all the old ones. I think @rt2zz has very limited time to spend working on redux-persist, but maybe he could chime in. |
when no need of |
Anyone knows any solution on this? I know the issue is for like 2 years ago but I couldn't find any way to persist my redux state. Clearly redux-persist is not a solution. I tried to implement it my self using local storage but because the reducers are not loaded in the first place I get this error: |
@erfansamieyan The thing I've seen mentioned most often, which we haven't done in our code yet because it's all redux-persisted and I'm scared to touch it, is this: https://medium.com/@jrcreencia/persisting-redux-state-to-local-storage-f81eb0b90e7e I've seen multiple smart people say "just throttle it to save once per second" as demonstrated there. Let me know how it turns out... we might do this soon in my app. |
@erfansamieyan my project is using slightly modified react-boilerplate that is as current as november 2019, my persist setup is still the same as my comment above #815 (comment) and still works |
configureStore.js
reducers.js
app.js
[


](url)
The text was updated successfully, but these errors were encountered: