action creator
is used bydispatch
dispatch
sends new state toSTORE
STORE
sends the new state toreducer
reducer
a function which returns updated state according toactions.type
updated state is sent to
STORE
STORE
will sent the state toReact Component
useEffect
inTasks.jsx
callsfetchTask()
- received by
redux-thunk
which enables us to useasync
operations
Redux-thunk flow
View
-dispatches-> Async Action
-sends HTTP req-> Wait for HTTP response
-Dispatch new action with HTTP response-> Reducer
-Return new state-> Store
-Update new state to-> View