ObservableState

public class ObservableState<Element> : Observable<Element>

An observable that holds the current value as the current state.

You can use updates to receive only future updates in a new observable.

  • The current state of this Observable

    Declaration

    Swift

    public var value: Element { get }
  • Creates an ObservableState which can not emit other events, therefore keeping it’s value constant.

    Declaration

    Swift

    public class func constant(_ value: Element) -> ObservableState<Element>
  • Returns an observable that emits only new updates of this State.

    Declaration

    Swift

    public func updates() -> Observable<Element>