I am using Axios, Redux and Redux Promise Middleware.
I have the following action creator:
return {
type: 'FETCH_USERS',
payload: axios.get('http://localhost:8080/users',
{
params: {
page
}
}
)
}
In my reducer for the FETCH_USERS_PENDING
action, I would like to save the requested url in my state. How can I do this?
Simply pass the URL in the action as well:
and access it in the reducer with
action.url
. Or you can leave the action as it is, and access it in the promise resolution: