StreamType

public protocol StreamType

A protocol that denotes a type that sends values over time.

  • The type of the values within the Stream.

    Declaration

    Swift

    associatedtype ValueType
  • The type of the disposable object returned from a subscription. If you can’t conform the disposable of your choice FRP library to SubscriptionReferenceType, you can create a struct to contain the disposable and return that instead. If your choice FRP library does not provide a disposable type, you can create an empty struct, and simply return nil from subscribe(_:).

    Declaration

    Swift

    associatedtype DisposableType : SubscriptionReferenceType
  • Register a callback to be called when new values flow down the stream.

    Declaration

    Swift

    func subscribe(_ function: @escaping (ValueType) -> Void) -> DisposableType?