Last active
May 16, 2017 00:03
-
-
Save julianfalcionelli/e18347c76f947d07ecdbaa7fc7b0ee74 to your computer and use it in GitHub Desktop.
Observable Example with Lambda
This file contains 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
//--- | |
Observable | |
.just(1, 2, 3, 4, 5) | |
.filter(integer -> integer % 2 != 0) | |
.subscribe( | |
integer -> Log.i(TAG, String.valueOf(integer)), | |
error -> Log.e(TAG, "Error"), | |
() -> Log.i(TAG, "No more results") | |
); | |
//This will log 1 - 3 - 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment