-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add .materialize() for Single, Maybe, Completable #1982
Comments
I'm not sure this would bring any significant benefit. This code is more verbose
but provides me with more information than
The return type obviously can't be
This is again not true. It's I guess there is a chance we could add Let's wait a bit on this. |
Thank you for your attention :) service.get().asObservable().materialize() doesn't do what I want. I want to materialize
It always contains the element which type is
Dematerialize Why do you think it should be |
This is too confusing. Let's continue discussion on the PR. |
Working with sequence of events instead of elements might be important in some cases. When we want to prevent sequence from completion. Or with RxSwiftExt
.elements()
and.errros()
operators, which is useful in error handling idiom:Using
single.asObervable().materialize()
looks strange for me. It can be cutted to simplesingle.materialize()
. Also we lose trait guarantees, because of cast toObservable
.I can't see any reasons why we can't materialize
Single
orMaybe
.My suggestion is to add
.materialize()
toCompletable
,Maybe
andSingle
. Return type would beSingle<Event<Element>>
. And.dematerialize()
forSingle
return type would beMaybe<T>
Here is the same issue & PR for RxJava - ReactiveX/RxJava#6278
What do you think @kzaher? Please, share your thoughts. I am ready to contribute :)
Here is a possible implementation - #1970
The text was updated successfully, but these errors were encountered: