Skip to content

Instantly share code, notes, and snippets.

@douglasiacovelli
Last active November 3, 2017 18:28
Show Gist options
  • Save douglasiacovelli/31838694ed638ca65a645fc7af22f278 to your computer and use it in GitHub Desktop.
Save douglasiacovelli/31838694ed638ca65a645fc7af22f278 to your computer and use it in GitHub Desktop.
Observable.just("Will")
.observeOn(Schedulers.io())
.flatMap({ name ->
updateUserName.execute(name) //returns another Observable<ApiResult> after calling the API
})
.subscribe({ apiResult ->
//what if you want to use the name here again to update the local cache for example if
//everything goes right with the API?
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment