In my React/Redux application, I have some async actions.
Let's say a user initiates a getData
request to the server. Immediately a GET_DATA_REQUEST
is being dispatched and the getData
AJAX call is on its way to the server.
Upon success or failure, a GET_DATA_SUCCESS
or GET_DATA_FAILURE
actions are dispatched accordingly and the data is rendered to the UI.
Now, I want my application to push history state (using react-router-redux
) as a reaction to the AJAX callback. Meaning, upon success, the users is "redirected" to another URL (route) the displays a different module that depends on the newly received data.
I realize it's a very bad idea to have this functionality in the reducer, as it won't be pure anymore (URL change is a side effect).
Any thoughts?
Thanks