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
For example, this library could provide its own first operator which would return Observable<Option<T>>. If the observable is empty, the observable would emit none instead of throwing an exception / emitting an error.
The text was updated successfully, but these errors were encountered:
Here's another one: fromFetch. If the user loses connectivity by the time you subscribe to the observable, fetch will reject and thereby the observable will emit an error.
Here's a wrapper we've been using at Unsplash around RxJS' fromFetch.
🚀 Feature request
Current Behavior
In RxJS, some operators are known to throw exceptions intentionally, in non-exceptional circumstances.
For example, the
first
operator will throw anEmptyError
if the observable completes after having emitted no items (an empty observable). https://rxjs-dev.firebaseapp.com/api/operators/firstOther operators which throw:
last
,single
, and the forthcominglastValueFrom
/firstValueFrom
(RxJS 7).Desired Behavior
Operators which don't throw.
Suggested Solution
For example, this library could provide its own
first
operator which would returnObservable<Option<T>>
. If the observable is empty, the observable would emitnone
instead of throwing an exception / emitting an error.The text was updated successfully, but these errors were encountered: