Last active
November 21, 2018 03:07
-
-
Save koifish082/216eab1fd9e868c0906b62bb9afb9c0c 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
Maybe<List<Long>> maybe = Maybe | |
.zip( | |
webViewRepository.getHabitReadArticle(webView), | |
habitReadArticleDao.getAll(), | |
new BiFunction<HabitReadArticleWebViewLocal, List<HabitReadArticle>, List<Long>>() { | |
@Override | |
public List<Long> apply(HabitReadArticleWebViewLocal habitReadArticleWebViewLocal, List<HabitReadArticle> habitReadArticles) throws Exception { | |
if (!hasSameArticleIds(habitReadArticleWebViewLocal, habitReadArticles)) { | |
return saveArticles(habitReadArticleWebViewLocal); | |
} | |
return null; | |
} | |
} | |
) | |
.subscribeOn(Schedulers.io()) | |
.observeOn(AndroidSchedulers.mainThread()); | |
disposables.add(maybe.subscribeWith(new ImportWebViewLocalObserver())); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment