ActionDispatcher

public protocol ActionDispatcher

An object that dispatches actions to a store.

Once an action is sent, the sender shouldn’t expect anything to occur. Instead, it should rely solely on changes to the state of the application to respond.

  • Sends an action to a reducer to mutate the state of the application.

    Declaration

    Swift

    func send(_ action: Action)

    Parameters

    action

    An action to dispatch to the store.

  • callAsFunction(_:) Extension method

    Sends an action to a reducer to mutate the state of the application.

    Declaration

    Swift

    @inlinable
    public func callAsFunction(_ action: Action)

    Parameters

    action

    An action to dispatch to the store

  • sendAsCancellable(_:) Extension method

    Send an action plan that returns a cancellable object.

    Declaration

    Swift

    @inlinable
    public func sendAsCancellable<T>(_ actionPlan: ActionPlan<T>) -> AnyCancellable

    Parameters

    actionPlan

    The action

    Return Value

    A cancellable to cancel the action.