title: Using Redux.createStore with Immutable throws "reducer is not a function (How to use Redux with Immutable.js ans composeEnhancers)
body: <p>I wrote this code to create Redux <code>store</code>:</p>
  
  <pre><code>import {combineReducers} from 'redux-immutable'
  
  const MyAppReducers = combineReducers({
      Node1: Node1Reducer,
      Node2: Node2Reducer,
      Node3: Node3Reducer,
      Node4: Node4Reducer
  })
  
  let store = createStore(
      MyAppReducers,
      composeEnhancers(
          applyMiddleware(
              thunkMiddleware,
              ApiMiddleware,
              loggerMiddleware
          )
      )
  )
  </code></pre>
  
  <p>The result of this configuration is a plain object with inside the <code>Immutable.Map()</code>s: </p>
  
  <pre><code>{
      Node1: Immutable.Map(),
      Node2: Immutable.Map(),
      Node3: Immutable.Map(),
      Node4: Immutable.Map()
  }
  </code></pre>
  
  <p>I want, instead, that all the state tree is an <code>Immutable.Map()</code>.</p>
  
  <p>So I tried to pass to <code>combineReducers()</code> directly an <code>Immutable.Map()</code> object:</p>
  
  <pre><code>const MyAppReducers = combineReducers(Immutable.Map({
      Node1: Node1Reducer,
      Node2: Node2Reducer,
      Node3: Node3Reducer,
      Node4: Node4Reducer
  }))
  </code></pre>
  
  <p>But this throws an error in the console:</p>
  
  <blockquote>
    <p>Uncaught TypeError: reducer is not a function</p>
    
    <p>at combineReducers.js:39</p>
    
    <p>at Array.forEach ()</p>
    
    <p>at combineReducers.js:36</p>
    
    <p>at Map.withMutations (immutable.js:1353)</p>
    
    <p>at combineReducers.js:35</p>
    
    <p>at computeNextEntry (:2:27469)</p>
    
    <p>at recomputeStates (:2:27769)</p>
    
    <p>at :2:31382</p>
    
    <p>at dispatch (createStore.js:165)</p>
    
    <p>at createStore (createStore.js:240)</p>
  </blockquote>
  
  <p>The documentation of <code>redux-immutable</code> states that I should pass the <code>initialState</code> as a second argument of the <code>createStore</code> function, but my second argument is currently the <code>composeEnhancers</code> function that I need to configure middlewares and other things.</p>
  
  <p><strong>How can I make the entire state tree be an <code>Immutable.Map()</code> object?</strong></p>