This is RxJS v 4. Find the latest version here
Invokes the specified function asynchronously on the specified scheduler, surfacing the result through an observable sequence.
func
(Function
): Function to run asynchronously.[context]
(Any
): The context for the func parameter to be executed. If not specified, defaults to undefined.[scheduler=Rx.Scheduler.timeout]
(Scheduler
): Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.
(Observable
): An observable sequence exposing the function's result value, or an exception.
var context = { value: 42 };
var source = Rx.Observable.start(
function () {
return this.value;
},
context,
Rx.Scheduler.timeout
);
var subscription = source.subscribe(
function (x) {
console.log('Next: ' + x);
},
function (err) {
console.log('Error: ' + err);
},
function () {
console.log('Completed');
});
// => Next: 42
// => Completed
File:
Dist:
Prerequisites:
- If using rx.async.js | rx.async.compat.js
NPM Packages:
NuGet Packages:
Unit Tests: