Given an observable that emits at least one value, Observable.single emits a single "undefined" value, rather than a NoSuchElementException. This is unexpected, and contradicts the documentation.
Code sample:
Rx.Observable.from([1,2,3])
.single(n => n > 10)
.subscribe(
n => console.log(`number is ${n}`),
e => console.error(`error is ${e}`));
Result:
number is undefined
Expected result:
error is NoSuchElementException: no elements in sequence
Given an observable that emits at least one value, Observable.single emits a single "undefined" value, rather than a NoSuchElementException. This is unexpected, and contradicts the documentation.
Code sample:
Result:
Expected result: