-
Notifications
You must be signed in to change notification settings - Fork 456
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ import io.reactivex.Observable | |
import java.util.concurrent.Callable | ||
import java.util.concurrent.Future | ||
|
||
@Deprecated("This will be removed in a future release due to API confusion") | ||
fun <T : Any> T?.toMaybe(): Maybe<T> = Maybe.create { s -> if (this != null) s.onSuccess(this); s.onComplete() } | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
thomasnield
Author
Collaborator
|
||
fun <T : Any> Future<T>.toMaybe(): Maybe<T> = Maybe.fromFuture(this) | ||
fun <T : Any> Callable<T>.toMaybe(): Maybe<T> = Maybe.fromCallable(this) | ||
|
3 comments
on commit c278332
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me extension for Any object is very bad idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason for the extension of Any
is to prevent it being done to a nullable type. If you have some specific examples why you think this is suboptimal, please file an issue and we all can discuss...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marcinsus in hindsight, you were absolutely right. Removing these right now.
Why you not use Maybe.just and Maybe.empty? This will be more effecient way and you can use better kotlin synax.