-
Notifications
You must be signed in to change notification settings - Fork 456
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
Order of subscribeBy parameters is not the same as standard RxJava's subscribe #174
Comments
I think I reversed the order for that reason that passing one nameless parameter attached to the |
It is the case. The best way to solve this would be overloads though.
…On Wed, Mar 7, 2018 at 3:16 PM Thomas Nield ***@***.***> wrote:
I think I reversed the order for that reason that passing one nameless
parameter attached to the onSuccess(). Now if this isn't the case
anymore, it needs to be investigated and possibly changed.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#174 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEEEUszAfs3i_w3tstpbUsUUSve6ykzks5tcD5HgaJpZM4SbDZ9>
.
|
I'm sorry, I don't understand this sentence "I think I reversed the order for that reason that passing one nameless parameter attached to the onSuccess()." |
@BoD Try this and you should see it works with the current setup: mySingle.subscribeBy { result -> println(result) } @JakeWharton and yes, overloads are probably the most effective way to fix this. Accepting PR's from anyone as I'm kind of busy right now. |
You are right, it works indeed, so the last part of what I wrote is incorrect. I can't figure out right now what I did that made me think the single parameter was |
Don't think there is any problem here. Passing multiple lambdas in one function would any way benefits from named parameters. |
@BoD Because
is not the same as
I thought the order of arguments of
|
Umm I don't understand how these working, I never found onError throwing any errors. Its seems like its just there for no reason |
With standard RxJava, you can do:
so one would suppose that with RxKotlin you could do
but in fact, this is not possible, because the first parameter is
onError
, and the second one isonSuccess
, which is the opposite of the order you have on RxJava'ssubscribe
.Because of this, you are forced to use named parameters like this...
That's too bad :(
But it's even more confusing if you pass only one parameter. One would expect that it would be
onSuccess
(line standard RxJava method that takes only one parameter), but in fact it'sonError
, which is very counter intuitive and surprising.The text was updated successfully, but these errors were encountered: