我们什么时候应该使用doOnNext()可观察的,而不是仅仅onNext()?
在哪些情况下我应该使用doOnNext,在哪些情况下doOnEach?
.doOnEach(new Action1<Notification<? super MessageProfile>>() {
@Override
public void call(Notification<? super MessageProfile> notification) {
}
})
.doOnNext(new Action1<MessageProfile>() {
@Override
public void call(MessageProfile profile) {
messageProfileDao.save(profile);
}
})
Run Code Online (Sandbox Code Playgroud)
这看起来两个运算符具有相同的效果.