Type Alias ObservableLike<ValueType>

ObservableLike: {
    "[observable]"(): ObservableLike<ValueType>;
    subscribe(observer?: Partial<Observer<ValueType>>): Unsubscribable;
}

Matches a value that is like an Observable.

Type Parameters

  • ValueType = unknown

Type declaration

The TC39 Observable proposal defines 2 forms of subscribe():

  1. Three callback arguments: subscribe(observer: OnNext<ValueType>, onError?: OnError, onComplete?: OnComplete): Unsubscribable;
  2. A single observer argument: (as defined below)

But Observable implementations have evolved to preferring case 2 and some implementations choose not to implement case 1. Therefore, an ObservableLike cannot be trusted to implement the first case. (xstream and hand built observerables often do not implement case 1)