Skip to content

Latest commit

 

History

History
57 lines (44 loc) · 2.14 KB

all.md

File metadata and controls

57 lines (44 loc) · 2.14 KB

Rx.Observable.prototype.all(predicate, [thisArg])

Rx.Observable.prototype.every(predicate, [thisArg])

Determines whether all elements of an observable sequence satisfy a condition.

Arguments

  1. predicate (Function): A function to test each element for a condition.
  2. [thisArg] (Function): Object to use as this when executing callback.

Returns

(Observable): An observable sequence containing a single element determining whether all elements in the source sequence pass the test in the specified predicate.

Example

var source = Rx.Observable.fromArray([1,2,3,4,5])
    .all(function (x) {
        return x < 6;
    });

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

// => Next: true
// => Completed    

Location

File:

Dist:

Prerequisites:

NPM Packages:

NuGet Packages:

Unit Tests: