Skip to content
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

Change the order of the Interactor#execute() method parameters #59

Closed
DmitriyZaitsev opened this issue May 9, 2018 · 0 comments
Closed
Assignees
Projects

Comments

@DmitriyZaitsev
Copy link
Contributor

Now all of the execute methods have requestModel the last parameter:

no param w/ param
execute(onNext) execute(onNext, requestModel)
execute(onNext, onError) execute(onNext, onError, requestModel)
execute(onNext, onError, onComplete) execute(onNext, onError, onComplete, requestModel)

This is not friendly with Kotlin where if the last parameter of a function accepts a function, a lambda expression that is passed as the corresponding argument can be placed outside the parentheses.
So, now in Kotlin we need to write:

interactor.execute({ item -> doSomething(item) }, param)

instead of:

interactor.execute(param) {
    item -> doSomething(item)
}

At the same time, the current order causes issues with correct type inference.
I think, it's reasonable to make responseModel the first parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
RxViper
In Progress
Development

No branches or pull requests

1 participant