Implementing redirect in Redux middleware
Instead of creating your custom promiseMiddleware you could use the redux-thunk middleware which accepts a function as an action. And the function will be called with dispatch and getStore as parameters.

Imagine you would like to fetch some data.. and you want to do it as an action. like dispatch(getPost(id))

normally your actionCreator getPost would return the action object, 

const getPost = (id) =&gt; {
  return {
    type: "FETCH_POST",
    id
  }
}


But when you use redux-thunk you can return a function:

const getPost = (postId) =&gt; {
  return dispatch =&gt; {
      // Now you can use dispatch inside this block, even for async calls..
      // Start fetching.. 
      dispatch({type: "START_LOADING_POST" }) // imagine this could change your state to {isLoading: true}

      http
       .get("from.somewhere.net/post/" + postId)
       .then((data) =&gt; dispatch({type: "POST_LOADED_SUCCESS", postId, data }))
       .catch((error) =&gt; dispatch(loadingPostFailed({postId, error})))
  }
}


I think you know how to apply the middleware to the store, so I skip it. Hope it makes it clear how you can extend your actionCreators with redux-thunk to functions and use them specially for async tasks, like promises or even with callback-based libraries.

Redux thunk was part of redux, but its now an own package, but also maintained by Dan Abramov, check out the repo: https://github.com/gaearon/redux-thunk

If you would like to save some time by writing every actionCreator by hand you could create an creator for the actionCreator :D sounds funny, but take a look at this:

const promiseActionCreator = type =&gt; {
   const
      start    = type + "_START",
      resolved = type + "_RESOLVED",
      failed   = type + "_FAILED";

   return (params) =&gt; (dispatch, getState) =&gt; {

      dispatch({type: start})

      http
          .get(params.url)
          .then(result =&gt; dispatch({type: resolved, result }))
          .catch(error =&gt; dispatch({type: failed, error }))
   }
}

// Now you can create/generate your special promise based actionCreator
const getPost = promiseActionCreator("POST_LOADER");