rt2zz / redux-persist-immutable

Redux Persist Immutable
MIT License
114 stars 31 forks source link

"'state.has' is not a function" error #34

Open kbaird5 opened 7 years ago

kbaird5 commented 7 years ago

Using this code, I was getting the 'state.forEach' is not a function error. Now, I seem to get 'state.has' is not a function error. I assume these errors are related to having immutablejs just on substate instead of the full state. I verified that using a single state works. What is the magic to get multiple substates to work? Thanks.

const combinedReducers = combineReducers( { subStateA: stateAReducer, subStateB: stateBReducer } );

// combine initial state here; or set as default value on reducer which will be loaded when the reducer is const combinedInitialState = { subStateA: fromJS(subStateBInitialData), subStateB: fromJS(subStateBInitialData) };

const store = createStore(combinedReducers, combinedInitialState, composeEnhancers(middleware, autoRehydrate()));

persistStore(store);

indrasantosa commented 6 years ago

I'm also having the same issue. Is there any work around for this?

JenilynnB commented 6 years ago

Same issue here. Any resolution or help on this?

nclsjstnn commented 6 years ago

me too