public protocol Middleware
Extends the store functionality by providing a middle layer between dispatched actions and the store’s reducer.
Before an action is given to a reducer, middleware have an opportunity to handle it themselves. They may dispatch their own actions, transform the current action, or block it entirely.
Middleware can also be used to set up external hooks from services.
Perform any middleware actions within this function.
The store object. Use
store.nextwhen the middleware is complete.
The latest dispatched action to process.
An optional action to pass to the next middleware.