Skip to content

Latest commit

 

History

History
58 lines (45 loc) · 2.16 KB

forkjoin.md

File metadata and controls

58 lines (45 loc) · 2.16 KB

Rx.Observable.forkJoin(...args)

Runs all observable sequences in parallel and collect their last elements.

Arguments

  1. args (Arguments | Array): An array or arguments of Observable sequences or Promises to collect the last elements for.

Returns

(Observable): An observable sequence with an array collecting the last elements of all the input sequences.

Example

/* Using observables and Promises */
var source = Rx.Observable.forkJoin(
    Rx.Observable.return(42),
    Rx.Observable.range(0, 10),
    Rx.Observable.from([1,2,3]),
    RSVP.Promise.resolve(56)
);

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

// => Next: [42, 9, 3, 56]
// => Completed

Location

File:

Dist:

Prerequisites:

NPM Packages:

NuGet Packages:

Unit Tests: