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
so if there isn't any matching element only undefined will be emitted.
Maybe it'd be better to align single also can accept default value?
Initial PR mimics existing behavior (do not accept default value) is created at #322
The text was updated successfully, but these errors were encountered:
At second thought, feeling it may be better to leave single as is since first does jobs for default value and single specifically guarantees if there is only single matching element. Leave issue opened to get clarification for now.
In case of
last
operator, it's allows to specify default value if there isn't any matching element.Rx.Observable.prototype.last([predicate], [thisArg], [defaultValue])
single
does similar jobs as operator that returns first matching element instead of last, but it does not allows to specify default value asRx.Observable.prototype.single(predicate, [thisArg])
so if there isn't any matching element only
undefined
will be emitted.Maybe it'd be better to align
single
also can accept default value?Initial PR mimics existing behavior (do not accept default value) is created at #322
The text was updated successfully, but these errors were encountered: