Observable

public protocol Observable

Represents a changing stream of values that can be observed.

  • The type of value that will be emitted by the observable type.

    Declaration

    Swift

    associatedtype Value
  • Observers are closures that take a single Element.

    Declaration

    Swift

    typealias Observer = (Value) -> Void
  • Adds a new observer.

    Declaration

    Swift

    @discardableResult
    func observe(_ observer: @escaping Observer) -> Subscription

    Parameters

    observer

    The observer to be added.

    Return Value

    A Subscription instance.