Observable

public class Observable<Element> : ObservableType

A type-erased ObservableType.

It represents a push style sequence.

  • E

    Type of elements in sequence.

    Declaration

    Swift

    public typealias E = Element
  • Declaration

    Swift

    public func subscribe<O>(_ observer: O) -> Disposable where Element == O.E, O : ObserverType
  • Declaration

    Swift

    public func asObservable() -> Observable<E>
  • Converts a optional to an observable sequence.

    Declaration

    Swift

    @available(*, deprecated, renamed: "from(optional:﹚", message: "Implicit conversions from any type to optional type are allowed and that is causing issues with `from` operator overloading.")
    public static func from(_ optional: E?) -> Observable<E>

    Parameters

    optional

    Optional element in the resulting observable sequence.

    Return Value

    An observable sequence containing the wrapped value or not from given optional.

  • Converts a optional to an observable sequence.

    Declaration

    Swift

    @available(*, deprecated, renamed: "from(optional:scheduler:﹚", message: "Implicit conversions from any type to optional type are allowed and that is causing issues with `from` operator overloading.")
    public static func from(_ optional: E?, scheduler: ImmediateSchedulerType) -> Observable<E>

    Parameters

    optional

    Optional element in the resulting observable sequence.

    scheduler

    Scheduler to send the optional element on.

    Return Value

    An observable sequence containing the wrapped value or not from given optional.