Created
February 8, 2013 17:19
-
-
Save benjchristensen/4740481 to your computer and use it in GitHub Desktop.
Basic RxJava-Scala examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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