ActionProtocol

public protocol ActionProtocol

A protocol for Actions for generic constraints and code reuse.

  • The type of the values output from the action.

    Declaration

    Swift

    associatedtype Output
  • The type of the values used as inputs to the action.

    Declaration

    Swift

    associatedtype Input
  • The type of errors emitted by the action.

    Declaration

    Swift

    associatedtype Error : Error
  • The type of errors emitted when applying the action.

    Declaration

    Swift

    associatedtype ApplyError : Error
  • Whether the action is currently executing.

    Declaration

    Swift

    var isExecuting: Property<Bool> { get }
  • Whether the action is currently enabled.

    Declaration

    Swift

    var isEnabled: Property<Bool> { get }
  • A signal of all events generated from all units of work of the Action.

    In other words, this sends every Event from every unit of work that the Action executes.

    Declaration

    Swift

    var events: Signal<Signal<Output, Error>.Event, NoError> { get }
  • A signal of all values generated from all units of work of the Action.

    In other words, this sends every value from every unit of work that the Action executes.

    Declaration

    Swift

    var values: Signal<Output, NoError> { get }
  • A signal of all errors generated from all units of work of the Action.

    In other words, this sends every error from every unit of work that the Action executes.

    Declaration

    Swift

    var errors: Signal<Error, NoError> { get }
  • The lifetime of the Action.

    Declaration

    Swift

    var lifetime: Lifetime { get }
  • Create a SignalProducer that would attempt to create and start a unit of work of the Action. The SignalProducer would forward only events generated by the unit of work it created.

    Declaration

    Swift

    func apply(_ input: Input) -> SignalProducer<Output, ApplyError>

    Parameters

    input

    A value to be used to create the unit of work.

    Return Value

    A producer that forwards events generated by its started unit of work, or returns an appropriate ApplyError indicating the specific error that happened.

  • apply() Extension method

    Create a SignalProducer that would attempt to create and start a unit of work of the Action. The SignalProducer would forward only events generated by the unit of work it created.

    Declaration

    Swift

    public func apply() -> SignalProducer<Output, ApplyError>

    Return Value

    A producer that forwards events generated by its started unit of work, or returns an appropriate ApplyError indicating the specific error that happened.

  • results Extension method

    A signal of all values or errors generated from all units of work of the Action.

    In other words, this sends every Result from every unit of work that the Action executes.

    Declaration

    Swift

    public var results: Signal<Result<Output, Error>, NoError> { get }