daily pastebin goal
63%
SHARE
TWEET

Untitled

a guest Apr 15th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         doOneThing() { callbackResult ->
  2.             doAnotherThing(callbackResult) { anotherCallbackResult ->
  3.                 doThirdThing(anotherCallbackResult) { totalResult ->
  4.                     showResultToUser(totalResult)
  5.                 }
  6.                
  7.             }
  8.         }
  9.  
  10.  
  11.        
  12.         val result = doOneThing().await()
  13.         val secondResult = doAnotherThing(result).await()
  14.         val totalResult = doThirdThing(secondResult).await()
  15.         showResultToUser(totalResult)
  16.        
  17.  
  18.  
  19.         Single.fromCallable(doOneThing())
  20.             .flatMap(::doAnotherThing)
  21.             .flatMap(::doThirdThing)
  22.             .subscribe(::showResultToUser)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top