Home Manual Reference Source Repository
import {Observable} from '@reactivex/rxjs/es6/Observable.js'
public class | source

Observable

Direct Subclass:

AjaxObservable, es6/observable/ArrayLikeObservable.js~ArrayLikeObservable, es6/observable/ArrayObservable.js~ArrayObservable, es6/observable/BoundCallbackObservable.js~BoundCallbackObservable, es6/observable/BoundNodeCallbackObservable.js~BoundNodeCallbackObservable, es6/testing/ColdObservable.js~ColdObservable, es6/observable/ConnectableObservable.js~ConnectableObservable, es6/observable/DeferObservable.js~DeferObservable, es6/observable/EmptyObservable.js~EmptyObservable, es6/observable/ErrorObservable.js~ErrorObservable, es6/observable/ForkJoinObservable.js~ForkJoinObservable, es6/observable/FromEventObservable.js~FromEventObservable, es6/observable/FromEventPatternObservable.js~FromEventPatternObservable, es6/observable/FromObservable.js~FromObservable, es6/operator/groupBy.js~GroupedObservable, es6/observable/IntervalObservable.js~IntervalObservable, es6/observable/IteratorObservable.js~IteratorObservable, es6/observable/NeverObservable.js~NeverObservable, es6/observable/PromiseObservable.js~PromiseObservable, es6/observable/RangeObservable.js~RangeObservable, es6/observable/ConnectableObservable.js~RefCountObservable, es6/observable/ScalarObservable.js~ScalarObservable, es6/Subject.js~Subject, es6/Subject.js~SubjectObservable, es6/observable/SubscribeOnObservable.js~SubscribeOnObservable, es6/operator/delayWhen.js~SubscriptionDelayObservable, es6/observable/TimerObservable.js~TimerObservable

Indirect Subclass:

es6/subject/AsyncSubject.js~AsyncSubject, es6/subject/BehaviorSubject.js~BehaviorSubject, es6/testing/HotObservable.js~HotObservable, es6/subject/ReplaySubject.js~ReplaySubject, es6/observable/dom/WebSocketSubject.js~WebSocketSubject

A representation of any set of values over any amount of time. This the most basic building block of RxJS.

Constructor Summary

Public Constructor
public

constructor(subscribe: Function)

Method Summary

Public Methods
public
public

forEach(next: Function, thisArg: any, PromiseCtor: PromiseConstructor): Promise

public

lift(operator: Operator): Observable

public

subscribe(observerOrNext: PartialObserver | Function, error: Function, complete: Function): Subscription

Public Constructors

public constructor(subscribe: Function) source

Params:

NameTypeAttributeDescription
subscribe Function

the function that is called when the Observable is initially subscribed to. This function is given a Subscriber, to which new values can be nexted, or an error method can be called to raise an error, or complete can be called to notify of a successful completion.

Public Methods

public [SymbolShim.observable](): Observable source

Return:

Observable

this instance of the observable

public forEach(next: Function, thisArg: any, PromiseCtor: PromiseConstructor): Promise source

Params:

NameTypeAttributeDescription
next Function

a handler for each value emitted by the observable

thisArg any
  • optional

a this context for the next handler function

PromiseCtor PromiseConstructor
  • optional

a constructor function used to instantiate the Promise

Return:

Promise

a promise that either resolves on observable completion or rejects with the handled error

public lift(operator: Operator): Observable source

Params:

NameTypeAttributeDescription
operator Operator

the operator defining the operation to take on the observable

Return:

Observable

a new observable with the Operator applied

public subscribe(observerOrNext: PartialObserver | Function, error: Function, complete: Function): Subscription source

Params:

NameTypeAttributeDescription
observerOrNext PartialObserver | Function

(optional) either an observer defining all functions to be called, or the first of three possible handlers, which is the handler for each value emitted from the observable.

error Function

(optional) a handler for a terminal event resulting from an error. If no error handler is provided, the error will be thrown as unhandled

complete Function

(optional) a handler for a terminal event resulting from successful completion.

Return:

Subscription

a subscription reference to the registered handlers