Skip to content

Instantly share code, notes, and snippets.

@benjchristensen
Created February 8, 2013 17:19
Show Gist options
  • Save benjchristensen/4740481 to your computer and use it in GitHub Desktop.
Save benjchristensen/4740481 to your computer and use it in GitHub Desktop.
Basic RxJava-Scala examples
@Test def runTests() {
// using closure
Observable.toObservable("1", "2", "3")
.take(2)
.subscribe((callback: String) => {
println(callback)
})
// using Map of closures
Observable.toObservable("1", "2", "3")
.take(2)
.subscribe(Map(
"onNext" -> ((callback: String) => {
println(callback)
})))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment