For reference, this is the origin of the below screenshots: https://github.com/gopinav/React-Redux-Tutorials/blob/master/redux-demo/asyncActions.js
Looking at the fetchUsers
action creator function in the below screenshot, how is dispatch
passed into this function? Not clear how the fetchUsers
function has access to dispatch and can pass it into the anonymous return function within fetchUsers
.
The store
creation in the 2nd screenshot is where the thunkMiddleware
is applied and the fetchUsers
is dispatched.