Created
June 11, 2020 09:08
-
-
Save MathiasSeguy-Android2EE/6d6690baa30ded9453fa235ddc78dc6c to your computer and use it in GitHub Desktop.
Markdium-Chapter 9: Observable's action operators
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
/** | |
* Using the observableSrc we use doOnNext to understand its behavior | |
*/ | |
public static Observable getObservableDoOnEach() { | |
return observableSrc | |
.doOnNext(it -> System.out.println("Size is " + it.length())); | |
} | |
/** | |
* OutPut result: | |
* doOnNext Size of Monday is 6 | |
* doOnNext Size of Tuesday is 7 | |
* doOnNext Size of Wednesday is 9 | |
* doOnNext Size of Thursday is 8 | |
* doOnNext Size of Friday is 6 | |
* doOnNext Size of Saturday is 8 | |
* doOnNext Size of Sunday is 6 | |
*/ | |
@Test | |
public void testDoOnNext() { | |
Answer9_ObservableActions.getObservableDoOnEach() | |
.subscribe(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment