Complete beginner as far as Redux+React (and ES6) goes so bear with me - I've got all the plumbing set up and all my states update as they should, but I'm still a little confused. Following along with a tutorial, one of the Redux actions starts off with:
export function getApiData(){
return(dispatch) => {return(dispatch) => { -some other actions here- }
}
This function fetches data from an API, so it also dispatches a getApiDataRequested and GetApiData success action, but the above does not make sense to me. Now I know that dispatches signal an intent to update the Redux state, but why is dispatch passed as parameter in the return function?
Cheers!