title: React-redux: place to prevent re-render after select same item
body: <p>I have react-redux app.</p>
  
  <p>In my app I have many places where user can select item, like - select main menu in side bar, select item main menu, select tab.</p>
  
  <p>Each one of this actions (select_manu, select_item) cause responses at several reducers.</p>
  
  <p>I want to prevent reducers change the state when the selected-item is the same as the current.</p>
  
  <p>My question is:</p>
  
  <p>Where is the right place to ask the follwing:</p>
  
  <pre><code> if (currentTab!= selectedTab)
  </code></pre>
  
  <p><strong>First option:</strong></p>
  
  <p>At the action-creator, by thunk. something like:</p>
  
  <pre><code>export const selectTab = (selectedTab) =&gt; {
    return {
      type: Const.SELECT_TAB,
      selectedTab
    }
  };
  
  export const tabClick = (tab) =&gt; {
        return function (dispatch, getState) {
             const currentTab = getState().active.tab;
             if (currentTab!= tab) {
                dispatch(selectTab(tab))
             }
        }
  </code></pre>
  
  <p>};</p>
  
  <p><strong>second option</strong>:</p>
  
  <p>At the container, something like:</p>
  
  <pre><code>const mergeProps = (stateProps, dispatchProps, ownProps) =&gt; {
  
  return {
  
    onTabSelection: (tab) =&gt; {
      if (tab != stateProps.tab)
        dispatch(selectTab(tab));
    }
  </code></pre>