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.executeon that action - the action
executeis executed which receives thegetStateanddispatchfunction as its parameters - the
executecalls 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
View on GitHub
AsyncMiddleware Struct Reference