Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

Latest commit

 

History

History
58 lines (45 loc) · 2.1 KB

startasync.md

File metadata and controls

58 lines (45 loc) · 2.1 KB

Rx.Observable.startAsync(functionAsync)

Invokes the asynchronous function, surfacing the result through an observable sequence.

Arguments

  1. functionAsync (Function): Asynchronous function which returns a Promise to run.

Returns

(Observable): An observable sequence exposing the function's Promises's value or error.

Example

var source = Rx.Observable.startAsync(function () {
    return RSVP.Promise.resolve(42);
});

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:

Prerequisites:

NPM Packages:

NuGet Packages:

Unit Tests: