Skip to content

Latest commit

 

History

History
70 lines (55 loc) · 2.22 KB

isempty.md

File metadata and controls

70 lines (55 loc) · 2.22 KB

Rx.Observable.prototype.isEmpty()

Determines whether an observable sequence is empty.

Returns

(Observable): An observable sequence containing a single element determining whether the source sequence is empty.

Example

/* Not empty */
var source = Rx.Observable.range(0, 5)
    .isEmpty()

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

// => Next: false
// => Completed

/* Empty */
var source = Rx.Observable.empty()
    .isEmpty()

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: