title: How to use redux thunk to redirect after success or error?
body: <p>I'm a newbie to Promises and React. I'm using redux-thunk in my action creators to resolve promises and I'm calling the action creators from my component. How do I route to a different URL after successful or unsuccessful request completion? I'm attaching the code for a delete function action creator. </p>
  
  <p>Should I set the state with a parameter (routeTo) when I dispatch it, on success? </p>
  
  <p>Here's the delete function: </p>
  
  <pre><code>export function deletePost(id){
      var request = axios.delete(`${ROOT_URL}posts/${id}${API_KEY}`);
  
      return function(dispatch){
          request.then((response)=&gt;{
              console.log("I deleted"+response.data.title);
          }).catch((error)=&gt;{
              console.log("DELETE_ERROR: "+JSON.stringify(error));
          });
      }
  }
  </code></pre>
  
  <p>I'm calling this function from an onclick function in my component.</p>
  
  <pre><code>deletePost(){
      this.props.deletePost(this.props.params.id);
  }
  </code></pre>