Using Redux Logger with Immutable

Switched over to Immutable but annoyed that the state being displayed by Redux Logger is now a little ugly and hard to parse?

Help is at hand with a one line fix. When creating the logger make sure to specify the stateTransformer function below and the complex Immutable internals will be converted back to an easy-to-read plain JavaScript object hierarchy.

import {createStore, applyMiddleware} from 'redux';  
import {Map} from 'immutable';  
import createLogger from 'redux-logger';

import appReducer from 'client/reducers/appReducer';

const initialState = Map({});

const store = createStore(appReducer, initialState, applyMiddleware(  
  createLogger({
    collapsed: true,
    stateTransformer: state => state.toJS()
  })
));

export default store;