title: How to abstract Multiple reducers with similar actions
body: <p>I have multiple entities in my application. Each entity is independent of others. So I have create a separate reducer for each entity and combining all of them while creating store. </p>
  
  <p>Every entry has some common actions like </p>
  
  <p>1) set list of items
  2) add single item
  3) update single item
  4) remove single item</p>
  
  <p>So pretty much in each reducer I have same kind of code repeating </p>
  
  <p><strong>setting list</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>return {
          ...state,
          list: {
              ...state.list,
              ...action.list
          }
   };
  </code></pre>
  
  <p><strong>Adding Single Item</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>return {
          ...state,
          list: {
              ...state.items,
              [action.item.id]: {
                  ...state.list[action.item.id],
                  ...action.item
              }
          }
   };
  </code></pre>
  
  <p>..similar code for Update action and remove action</p>
  
  <p><strong>Is there a how I can abstract out this code and still keep a separate reducer for each entity?</strong></p>