Skip to content

Latest commit

 

History

History
56 lines (43 loc) · 1.77 KB

asobservable.md

File metadata and controls

56 lines (43 loc) · 1.77 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: