You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation at http://reactivex.io/documentation/operators/first.html is slightly wrong for the find operator, in rxjs at least. Documentation says that find emits undefined when no element matches. This is not correct, actually it just completes the observable.
The sample given:
var array = [1,2,3,4];
var source = Rx.Observable.fromArray(array)
.find(function (x, i, obs) {
return x === 5;
});
var subscription = source.subscribe(
function (x) { console.log('Next: ' + x); },
function (err) { console.log('Error: ' + err); },
function () { console.log('Completed'); });
The documentation at http://reactivex.io/documentation/operators/first.html is slightly wrong for the find operator, in rxjs at least. Documentation says that find emits
undefined
when no element matches. This is not correct, actually it just completes the observable.The sample given:
outputs accordin to the documentation:
but actually outputs:
Completed
Also see rxjs documentation for find: https://github.com/Reactive-Extensions/RxJS/blob/master/doc/api/core/operators/find.md
The text was updated successfully, but these errors were encountered: