An example implementation is an action that sends user registration information to the action; then redirects the user to user's profile page on creation.
Currently I am setting state that is managed on the user registration page. When the state says the user is created, and passes the user id, they are redirected.
It would be 'simpler' to simply redirect from the action itself though via a browserhistory push.
I would love to know if this is anti-pattern, or an acceptable method
Sample redux-thunk's action psuedo-code:
export const apiNewSomething = (name, email, other) => {
return dispatch => {
return fetch(`//server/v1/something`, { method: "post", body: {name, email, other} })
.then((res) => {
dispatch(addSomethingToReduxAction(res))
browserHistory.push(`//server/something/${res.id}`)
}, (err) => {
console.log('danger will robinson!')
});
}
}