SignalProducer

struct SignalProducer<Value, Error> where Error : Error
  • Chain the receiver with another, creating a new Signal every time the receiver sends a value, and returning the resulting SignalProducer.

    Equivalent calling flatMap(_:, _:) with a flatten strategy of .latest and the same transform.

    Declaration

    Swift

    public func chain<U>(_ transform: @escaping (Value) -> Signal<U, NoError>) -> SignalProducer<U, NoError>

    Parameters

    transform

    A closure that takes a value emitted by the receiver, and that returns a Signal.

    Return Value

    The resulting SignalProducer.

  • Chain the receiver with another, creating a new SignalProducer every time the receiver sends a value, and returning the resulting SignalProducer.

    Equivalent calling flatMap(_:, _:) with a flatten strategy of .latest and the same transform.

    Declaration

    Swift

    public func chain<U>(_ transform: @escaping (Value) -> SignalProducer<U, NoError>) -> SignalProducer<U, NoError>

    Parameters

    transform

    A closure that takes a value emitted by the receiver, and that returns a SignalProducer.

    Return Value

    The resulting SignalProducer.

  • Chain the receiver with another, creating a new Property every time the receiver sends a value, and returning the resulting SignalProducer.

    Equivalent calling flatMap(_:, _:) with a flatten strategy of .latest and the same transform.

    Declaration

    Swift

    public func chain<P: PropertyProtocol>(_ transform: @escaping (Value) -> P) -> SignalProducer<P.Value, NoError>

    Parameters

    transform

    A closure that takes a value emitted by the receiver, and that returns a Property.

    Return Value

    The resulting SignalProducer.

  • Chain the receiver with another, creating a new Signal every time the receiver sends a value, and returning the resulting SignalProducer. If the new Signal is nil, the value is ignored.

    Equivalent calling flatMap(_:, _:) with a flatten strategy of .latest and the same transform.

    Declaration

    Swift

    public func chain<U>(_ transform: @escaping (Value) -> Signal<U, NoError>?) -> SignalProducer<U, NoError>

    Parameters

    transform

    A closure that takes a value emitted by the receiver, and that returns an optional Signal. If the Signal is nil, the value is ignored.

    Return Value

    The resulting SignalProducer.

  • Chain the receiver with another, creating a new SignalProducer every time the receiver sends a value, and returning the resulting SignalProducer. If the new Signal is nil, the value is ignored.

    Equivalent calling flatMap(_:, _:) with a flatten strategy of .latest and the same transform.

    Declaration

    Swift

    public func chain<U>(_ transform: @escaping (Value) -> SignalProducer<U, NoError>?) -> SignalProducer<U, NoError>

    Parameters

    transform

    A closure that takes a value emitted by the receiver, and that returns an optional SignalProducer. If the SignalProducer is nil, the value is ignored.

    Return Value

    The resulting SignalProducer.

  • Chain the receiver with another, creating a new Property every time the receiver sends a value, and returning the resulting SignalProducer. If the new Signal is nil, the value is ignored.

    Equivalent calling flatMap(_:, _:) with a flatten strategy of .latest and the same transform.

    Declaration

    Swift

    public func chain<P: PropertyProtocol>(_ transform: @escaping (Value) -> P?) -> SignalProducer<P.Value, NoError>

    Parameters

    transform

    A closure that takes a value emitted by the receiver, and that returns an optional Property. If the Property is nil, the value is ignored.

    Return Value

    The resulting SignalProducer.