title: Redux - calling a chain of functions in action or reducer?
body: <p>I have a logical issue, whether i should make a multiple function calls into response of each callback inside an actions:</p>
  
  <pre><code>export const myAction= () =&gt; (distaptch, getState) =&gt; {
      callFunctionA(function(e){
          if(e){
              dispatch(eventA(e));
  
              callFunctionB(function(e){
  
                  dispatch(eventB(e));
  
                  callFunctionC(function(e){
  
                      dispatch(eventC(e));
                  });
              });
          }
      });
  }
  </code></pre>
  
  <p>or i might want to move those calls into redux reducers and call every next function from there?</p>
  
  <pre><code>const reducer = (state={}, action) =&gt; {
    switch (action.type) {
      case 'EVENT_A':
  
        callFunctionB(action.e);
  
        return state;
      case 'EVENT_B':
  
          callFunctionC(action.e);
          return state;   
      default:
        return state
    }
  }
  </code></pre>
  
  <p>Second approach looks to me like anti-pattern which leads to spaghetti code... Maybe i am wrong?</p>