Last active
June 2, 2019 17:52
-
-
Save gianlucacandiotti/7284b8b0658290f87346e9af91eb6209 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createLogger } from 'redux-logger'; | |
const logger = createLogger({ | |
stateTransformer: (state) => { | |
const newState = {}; | |
const stateObj = state.toObject(); | |
for (const i of Object.keys(stateObj)) { | |
if (Iterable.isIterable(stateObj[i])) { | |
newState[i] = stateObj[i].toJS(); | |
} else { | |
newState[i] = stateObj[i]; | |
} | |
} | |
return newState; | |
} | |
}); | |
const store = createStore( | |
reducer, | |
Immutable.fromJS(preloadedState), | |
applyMiddleware(logger) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment