Skip to content

Instantly share code, notes, and snippets.

@IevgenOsetrov
Last active March 27, 2018 02:32
Show Gist options
  • Save IevgenOsetrov/755372a0789d2986524338c7311b11bc to your computer and use it in GitHub Desktop.
Save IevgenOsetrov/755372a0789d2986524338c7311b11bc to your computer and use it in GitHub Desktop.
Observable zip
restartableFirst(RESTARTABLE_SEND_COMPLAIN_TO_API_EMAIL, () -> Observable.zip(
AppApi.getInstance()
.getRestManager()
.sendUserComplainToAPI(name, phoneNumber, email, address, description, attachments),
AppApi.getInstance()
.getRestManager()
.sendUserComplainToEmail(name, phoneNumber, email, address, description, title, resourceId, attachments),
(complainResponseBaseResponse, messageBaseResponse) ->
new Pair<>(complainResponseBaseResponse.getData(), messageBaseResponse.getData())
).observeOn(AndroidSchedulers.mainThread()),
AddComplainActivity::onComplainSentToApi,
AddComplainActivity::onComplainSentToApiError);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment