title: Redux call function and dispatch type in same function
body: <p>I have a redux actions for sessiontimeout and logout. When Sessiontimeout called, Internally calling the logout function.</p>
  
  <p>It did not work also <code>SESSIONTIMEOUT</code> action type not dispatched.</p>
  
  <p>How I suppose to call logout in Sessiontimeout and dispatch both <code>SESSIONTIMEOUT</code> and <code>LOGOUT</code></p>
  
  <pre><code>export function sessionTimeOut(){
      return (dispatch) =&gt; {
      dispatch({
          type: ACTIONTYPES.SESSIONTIMEOUT
      })
      }
      logout()
  }
  
  export function logout(){
      history.push('/')
      return { 
          type: ACTIONTYPES.LOGOUT 
      }
  }
  </code></pre>