Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package cn.chenhaonee.wallet.rx;
- import io.reactivex.Observable;
- public class ScanExample {
- public void example() {
- Observable.just(1, 2, 3)
- .scan((i1, i2) -> i1 + i2)
- .subscribe(integer -> System.out.println("accept: scan " + integer));
- }
- public static void main(String[] args) {
- new ScanExample().example();
- }
- /**
- * Output:
- * accept: scan 1
- * accept: scan 3
- * accept: scan 6
- */
- }
Add Comment
Please, Sign In to add comment