Skip to content

Latest commit

 

History

History
57 lines (44 loc) · 1.86 KB

asobservable.md

File metadata and controls

57 lines (44 loc) · 1.86 KB

Rx.Observable.asObservable()

Hides the identity of an observable sequence.

Returns

(Observable): An observable sequence that hides the identity of the source sequence.

Example

// Create subject
var subject = new Rx.AsyncSubject();

// Send a value
subject.onNext(42);
subject.onCompleted();

// Hide its type
var source = subject.asObservable();

var subscription = source.subscribe(
    function (x) {
        console.log('Next: ' + x);
    },
    function (err) {
        console.log('Error: ' + err);
    },
    function () {
        console.log('Completed');
    });

// => Next: 42
// => Completed

Location

File:

Dist:

NPM Packages:

NuGet Packages:

Unit Tests: