Created
October 2, 2018 00:24
-
-
Save CoderJava/de3998cc2befdee9ed3b5e6d2b8279f8 to your computer and use it in GitHub Desktop.
Transforming Operator scan RxJava
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
| public class RxTransformingOperatorScan { | |
| public static void main(String[] args) { | |
| Observable.just(1, 2, 3, 4, 5) | |
| .scan((resultObserverPrevious, item) -> { | |
| System.out.println("x: " + resultObserverPrevious + " & y: " + item); | |
| return resultObserverPrevious + item; | |
| }) | |
| .subscribe(System.out::println); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment