-
Notifications
You must be signed in to change notification settings - Fork 23
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
meteorReduxReducers will be nested after persist/REHYDRATE? #27
Comments
Ah, right. This is probably because You might be able to get away with something as simple as: // line 86
const newReducers = (customReducers !== undefined) ? combineReducers({ ...customReducers, meteorReduxReducers }) : meteorReduxReducers;
const MeteorStore = createStore(newReducers, preloadedState, enhancer);
if (customReducers) MeteorStore.dispatch = MeteorStore.meteorReduxReducers.dispatch; |
@JulianKingman Sorry, I don't quite understand what's the difference between dispatched by MeteorStore and Meteor.meteorReduxReducers? Could you explain it with a bit more details, please? Also, we can't access to meteorReduxReducers as it is not directly under MeteorStore and it doesn't have a dispatch function as it is not a store object? We tried very hard today and here are some screen shots: We appreciate for your quick response :) |
I'm sorry, I led you astray there, it's not that the store gets nested, just the state. So now whenever you call So if you replace instances of const getState = typeof customReducers !== 'undefined' ? MeteorStore.getState().meteorReduxReducers : MeteorStore.getState();
_.each(getState, (collection, key) => {
// etc... |
No worries. After added these two lines of codes, good news is, we can be able to restore all the customReducers' states properly, but all the previous states would be nested into meteorReduxReducers again. Then after several times of refreshing the app, the size of meteorReduxReducers will increase largely. Is this problem caused by the 'rehydrated' step, which is from line 95 - 110? As the payload of current persist/REHYDRATE action doesn't overwrite prev state correctly? |
How is this working in v2, I haven't tested? |
Thanks @JulianKingman This problem still exists |
Hi @JulianKingman ,
why would the meteorReduxReducers be nested stored after persist/REHYDRATE? If so, the size of meteorReduxReducers will theoretically be close to infinity if we keep refreshing the app?
Regards,
The text was updated successfully, but these errors were encountered: