title: Cannot call one action from another in a React-Redux app
body: <p>I have a login modal. I use an action creator to turn isLoginModalVisible: true in the reducers. Calling the action creator inside a container, inside a component's onClick, like so:</p>
  
  <pre><code>&lt;TextButtonRight onClick={()=&gt; this.props.showLoginModal(true)}&gt; 
  </code></pre>
  
  <p>Inside the login modal, I have a login button that submits a form. I want the modal to disappear when 200OK otherwise, I display an error message in the modal. calling this action creator on login button click:</p>
  
  <pre><code>export function logInUser(){
      console.log("Actions--&gt; logInUser");
      //Imagine I got a 200OK
      dispatch(showLoginModal(false));
  
      return({
          type: UPDATE_USER_LOGGED_IN,
          payload: true
      });
  }
  </code></pre>
  
  <p>I'm calling the action creator to hide the modal from logInUser action creator and it's not working. The showLoginModal action creator does get hit but it does not dispatch to a reducer. </p>
  
  <p>Here's the showLoginModal action creator:</p>
  
  <pre><code>export function showLoginModal(bool){
      console.log("Actions--&gt; showLoginModal:"+bool);
      return({
          type: UPDATE_LOGIN_MODAL_VISIBLE,
          payload: bool
      });
  }
  </code></pre>
  
  <p>(I'm sorry if I'm making a rookie mistake)</p>
  
  <h2>Edit:</h2>
  
  <p>part of my reducer.It does work because that's how I show the login modal. I pass false when I want to hide it. There's no problem with the payload either. The console.log isn't getting get when I call it via another action creator. works okay when I pass it to onClick on submit button this way: 
  <code>onClick={()=&gt; this.props.showLoginModal(false)}</code></p>
  
  <pre><code>case UPDATE_LOGIN_MODAL_VISIBLE:
              console.log("REDUCER--&gt;"+UPDATE_LOGIN_MODAL_VISIBLE);
              return {...state, loginModalVisible: action.payload};
              break;
  </code></pre>
  
  <p>CombineReducers:</p>
  
  <pre><code>const rootReducer = combineReducers({
      posts: postsReducer, 
      displayComps: displayComponentsReducer,
      form: formReducer,
      searchForm: searchFormReducer
  });
  </code></pre>
  
  <h2>Edit 2:</h2>
  
  <p>Sorry, I should have mentioned that I am using thunk. I wanted to know if there was a way to call an action from this one, like so:</p>
  
  <pre><code>req.then((response)=&gt;{
      console.log("REQ_COMPLETE");
      dispatch({type: UPDATE_USER_LOGGED_IN, payload: true});
      //like so:
      showLoginModal(false);
      localStorage.setItem('userLoggedIn', true);
   })
  </code></pre>
  
  <p>instead of adding this:</p>
  
  <pre><code>dispatch({type: UPDATE_LOGIN_MODAL_VISIBLE, payload: false});
  </code></pre>
  
  <p>dispatching the action from another action creator seemed kinda hacky.</p>