Commit 836d57ab authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

fixed lifecycle presenter states merge

parent 0c8af564
......@@ -68,7 +68,7 @@ class ArticlesScreenController :
.debounce(600L, TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread())
private var silentCheck = true
private var silentCheck = false
set(value) {
Timber.d("silent value: old: $field new $value")
field = value
......
......@@ -72,13 +72,27 @@ class ArticlesScreenPresenter @Inject constructor(
.startWith(Observable.just<ArticlesScreenViewState>(ArticlesScreenViewState.Idle()))
val state = restoreStateObservable
.mergeWith(prefetchCards)
.mergeWith(getNewArticlesPage)
.mergeWith(fetchSubscription)
.mergeWith(onSubChecked)
val state =
Observable.mergeDelayError(
arrayListOf(
restoreStateObservable,
prefetchCards,
getNewArticlesPage,
fetchSubscription,
onSubChecked)
)
.doOnError { Timber.e(it) }
.onErrorReturn(::parseError)
// .mergeWith(prefetchCards)
// .mergeWith(getNewArticlesPage)
// .mergeWith(fetchSubscription)
// .mergeWith(onSubChecked)
// val safeState = Observable.mergeDelayError {
//
// }
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment