Skip to content

Instantly share code, notes, and snippets.

@SODA1127
Created January 7, 2020 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SODA1127/ace38d76ad15897724a4c14d40d23daf to your computer and use it in GitHub Desktop.
Save SODA1127/ace38d76ad15897724a4c14d40d23daf to your computer and use it in GitHub Desktop.
fun main(args: Array<String>) {
val observable: Observable<String> = listOf("String 1","String 2","String 3","String 4").toObservable()//1
observable.subscribe({//2
println("Received $it")
},{
println("Error ${it.message}")
},{
println("Done")
})
observable.subscribe({//3
println("Received $it")
},{
println("Error ${it.message}")
},{
println("Done")
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment