AsyncMiddleware
public struct AsyncMiddleware: Middleware
Async Middleware handles actions of type AsyncAction
AsyncAction
are not dispatched to the reducer
When AsyncMiddleware
intercepts an AsyncAction
it does the following:
- Call
action.execute
on that action - the action
execute
is executed which receives thegetState
anddispatch
function as its parameters - the
execute
calls dispatch as many times as wanted, dispatching new actions (can also disptach newAsyncAction
)
SeeAlso:
-
Undocumented
Declaration
Swift
public struct AsyncMiddleware: Middleware
-
Declaration
Swift
public func onAction(action: Action, getState: @escaping GetStateFunction, dispatch: @escaping DispatchFunction, next: @escaping NextFunction)
Parameters
action