title: Reusing reducer logic, action name is undefined
body: <p>I'm looking at this documentation page: <a href="https://redux.js.org/recipes/structuring-reducers/reusing-reducer-logic" rel="nofollow noreferrer">https://redux.js.org/recipes/structuring-reducers/reusing-reducer-logic</a> on redux. I'm trying to implement something like this:</p>
  
  <pre><code>function counter(state = 0, action) {
    switch (action.type) {
      case 'INCREMENT':
        return state + 1
      case 'DECREMENT':
        return state - 1
      default:
        return state
    }
  }
  
  function createNamedWrapperReducer(reducerFunction, reducerName) {
    return (state, action) =&gt; {
      const { name } = action
      const isInitializationCall = state === undefined
      if (name !== reducerName &amp;&amp; !isInitializationCall) return state
  
      return reducerFunction(state, action)
    }
  }
  
  const rootReducer = combineReducers({
    counterA: createNamedWrapperReducer(counter, 'A'),
    counterB: createNamedWrapperReducer(counter, 'B'),
    counterC: createNamedWrapperReducer(counter, 'C')
  })
  </code></pre>
  
  <p>However I don't understand how to get the name from <code>action</code>. And this code is not working on my project as <code>const { name } = action</code> is returning <code>undefined</code>.</p>
  
  <p>What I'm I missing? Is this example complete? How can I fix this?</p>