-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
toTaskX functions do not consider empty observables #61
Comments
@mlegenhausen thanks for reporting, toPromise<T>(this: Observable<T>): Promise<T> Is it possible to detect if an observable completes without emitting a value? |
Yes, this is demonstrated in a new |
Ok, so I guess we can do the same and define an internal |
So we would not |
Yes, like |
PR updated. |
🐛 Bug report
Current Behavior
Expected behavior
Instead of
Task<A>
we need to returnTask<Option<A>>
Reproducible example
See current behavior
Suggested solution(s)
We need to change all
toTaskX
function totoTaskOptionX
which get really ugly and before providing a PR I would like to discuss how the function forObservableThese
andObservableEither
should look like. I would actually consider to deprecate or even to remove them cause they are buggy and add no additional value over thetoTaskOption
function fromObservable
.Additional context
Currently it is only a runtime bug. With rxjs@7 we will get also a type error cause the signature of
toPromise
has changed to cover theundefined
case.Your environment
Which versions of fp-ts-rxjs are affected by this issue? Did this work in previous versions of fp-ts-rxjs?
All versions since 0.6.5
The text was updated successfully, but these errors were encountered: