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 mutate the application state.

    Declaration

    Swift

    func send(_ action: Action)

    Parameters

    action

    An action to dispatch to the store.

  • Sends a cancellable action to mutate the application state.

    Declaration

    Swift

    func sendAsCancellable(_ action: Action) -> Cancellable

    Parameters

    action

    An action to dispatch to the store.

    Return Value

    A cancellable object.

  • callAsFunction(_:) Extension method

    Sends an action to mutate the application state.

    Declaration

    Swift

    @inlinable
    public func callAsFunction(_ action: Action)

    Parameters

    action

    An action to dispatch to the store