In classic Redux, with no middleware, you cannot dispatch something that is not a pure object. With Redux Thunk, you can delay the dispatch by dispatching a function:
middleware allows you to write action creators that return a function instead of an action. The thunk can be used to delay the dispatch of an action, or to dispatch only if a certain condition is met. The inner function receives the store methods dispatch and getState as parameters.
- Redux Thunk official documentation, available at:
For instance, you can dispatch a function. Such a function has two arguments: dispatch and getState. This function does not reach the Redux reducers yet. It only delays the ...