title: React-Redux, how to subscribe to changes in state and apply actions
body: <p>I am building a grid and a filters component using react, redux and material-ui</p>
  
  <p>Here is how my filters state object in redux looks like</p>
  
  <pre><code>{
     1: {id:1, name:'firstName', value:'John'}
     2: {id:2, name:'LastName', value:'Doe'}
  }
  </code></pre>
  
  <p>Items object in the store</p>
  
  <pre><code>{
     12: {id:12, firstName:'John', lastName:'Doe', contact:''}
     13: {id:13, firstName:'Mark', lastName:'Doyle', contact:''}
   }
  </code></pre>
  
  <p>when ever the state of filters object changes in the store, I want execute applyFilters function to narrowdown items. What is the best pattern for subscribing to changes in a state object and executing an action to update the state of another object in a store? or is there a better way to handle this?</p>
  
  <p><strong>Current Implementation</strong></p>
  
  <p>I am not sure if this an anti-pattern to access state in action creator.</p>
  
  <pre><code>export function updateFilters(namespace, filter, filterText) { 
  
      return (dispatch, getState) =&gt; {
          // To update filters object in the store
          dispatch({
              type: `${namespace}/${UPDATE_FILTERS}`,
              value: filterText,
              payload: filter.get('id')
          })
  
          //Actual filtering
          let state = getState();
          let filters = state[`${namespace}`].filters;
          let items = state[`${namespace}`].items;
          let filteredItems = applyFilters(items, filters);
  
          // To update filteredItems in the store
          dispatch({
              type: `${namespace}/${APPLY_FILTERS}`,
              payload: filteredItems
          })
      }   
  }
  </code></pre>