Spawns a generator function which allows for Promises, Observable sequences, Arrays, Objects, Generators and functions.
fn(Function): The spawning function.
(Function): a function which has a done continuation.
var source = Rx.spawn(function* () {
yield Observable.just(1);
yield Promise.resolve(2);
yield 3;
})();
var subscription = source.subscribe(
function (x) {
console.log('Next: %s', x);
},
function (err) {
console.log('Error: %s', err);
},
function () {
console.log('Completed');
});
// => Next: 1
// => Next: 2
// => Next: 3
// => CompletedFile:
Dist:
Prerequisites:
NPM Packages:
NuGet Packages:
Unit Tests: