Middleware
Middleware is a higher-order function that composes a dispatch function to return a new dispatch function. It provides a third-party extension point between dispatching an action and the moment it reaches the reducer.
Signature: (api) => (next) => (action) => { ... }
Implementation
typedef Middleware<S> = MiddlewareTransform Function(MiddlewareApi<S> api);