ObserverProtocol

public protocol ObserverProtocol

Represents an observer over an observable sequence

  • The element types of the observer events

    Declaration

    Swift

    associatedtype Element
  • Notifies an event has occurred.

    Declaration

    Swift

    func on(_ event: Event<Element>)

    Parameters

    event

    The event that occurred

  • bind(from:) Extension method

    binds an observer from bindable object.

    For example, when you want to bind ui element value to property value changes.

    Declaration

    Swift

    func bind<B>(from bindable: B) -> Cancelable where B : Bindable, Self.Element == B.Element
  • asObserver Extension method

    Type erasure for any observer implementing the protocol to a general Observer (same concept as AnyObject)

    Declaration

    Swift

    var asObserver: Observer<Element> { get }
  • onNext(_:) Extension method

    Undocumented

    Declaration

    Swift

    func onNext(_ element: Element)
  • onCompleted() Extension method

    Undocumented

    Declaration

    Swift

    func onCompleted()
  • onError(_:) Extension method

    Undocumented

    Declaration

    Swift

    func onError(_ error: Swift.Error)