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
Since currently there is no Single class (like rxjava) in rxjs, it could be difficult for developers to figure out if the Observable only emits once. There are several discussion about this problem. E.g. ReactiveX/rxjs#5273.
We should use Promise instead of Observable to clearly indicate the behavior will only return ONE SINGLE value asynchronously. This would help developers to avoid lots of potential bugs when deciding which observable operator to use, such as forkJoin vs zip and toArray vs scan.
As a Promise can be easily transform into an Observable with defer function but it is an anti-pattern to transform an Observable into a Promise via toPromise function, we should:
Prefer Promise than Observable for return values.
Prefer Observable than Promise for parameters.
The text was updated successfully, but these errors were encountered:
Use Promise to Replace Observable Only Emitting Once. See #233.
- Remove impl suffix from table preferences classes.
- Remove unused utils.
- Suppress tslint:await-promise rule for crypto.ts.
Since currently there is no
Single
class (like rxjava) in rxjs, it could be difficult for developers to figure out if theObservable
only emits once. There are several discussion about this problem. E.g. ReactiveX/rxjs#5273.We should use
Promise
instead ofObservable
to clearly indicate the behavior will only return ONE SINGLE value asynchronously. This would help developers to avoid lots of potential bugs when deciding which observable operator to use, such asforkJoin
vszip
andtoArray
vsscan
.As a
Promise
can be easily transform into anObservable
withdefer
function but it is an anti-pattern to transform anObservable
into aPromise
viatoPromise
function, we should:Promise
thanObservable
for return values.Observable
thanPromise
for parameters.The text was updated successfully, but these errors were encountered: