Created
August 19, 2018 10:59
-
-
Save anitaa1990/72de811f44a65030adf7c26cef4772bc to your computer and use it in GitHub Desktop.
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 | |
.create(emitter -> { | |
for(int i=0; i<= 6; i++) { | |
Thread.sleep(1000); | |
emitter.onNext(i); | |
} | |
emitter.onComplete(); | |
}) | |
.skipWhile(new Predicate<Object>() { | |
@Override | |
public boolean test(Object o) throws Exception { | |
return (((Integer)o < 2)); | |
} | |
}) | |
.subscribe(new Observer<Object>() { | |
@Override | |
public void onSubscribe(Disposable d) { | |
} | |
@Override | |
public void onNext(Object o) { | |
System.out.println("onNext: " + o); | |
} | |
@Override | |
public void onError(Throwable e) { | |
} | |
@Override | |
public void onComplete() { | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment