Effect

public enum Effect<Environment>

A side effect that happens as a response to a dispatched Action.

An Effect can:

  • give a new Action to dispatch (a dispatchingOne effect)
  • give an array of new Actions to dispatch (a dispatchingMultiple effect)
  • give nothing (a nonDispatching effect)
  • An Effect that publishes an Action to dispatch.

    Declaration

    Swift

    case dispatchingOne(_: (AnyPublisher<Action, Never>, Environment) -> AnyPublisher<Action, Never>)
  • An Effect that publishes multiple Actions to dispatch.

    Declaration

    Swift

    case dispatchingMultiple(_: (AnyPublisher<Action, Never>, Environment) -> AnyPublisher<[Action], Never>)
  • An Effect that handles the action but doesn’t publish a new Action.

    Declaration

    Swift

    case nonDispatching(_: (AnyPublisher<Action, Never>, Environment) -> AnyCancellable)