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

fixed lifecycle presenter states merge

parent 0c8af564
...@@ -68,7 +68,7 @@ class ArticlesScreenController : ...@@ -68,7 +68,7 @@ class ArticlesScreenController :
.debounce(600L, TimeUnit.MILLISECONDS) .debounce(600L, TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
private var silentCheck = true private var silentCheck = false
set(value) { set(value) {
Timber.d("silent value: old: $field new $value") Timber.d("silent value: old: $field new $value")
field = value field = value
......
...@@ -72,13 +72,27 @@ class ArticlesScreenPresenter @Inject constructor( ...@@ -72,13 +72,27 @@ class ArticlesScreenPresenter @Inject constructor(
.startWith(Observable.just<ArticlesScreenViewState>(ArticlesScreenViewState.Idle())) .startWith(Observable.just<ArticlesScreenViewState>(ArticlesScreenViewState.Idle()))
val state = restoreStateObservable val state =
.mergeWith(prefetchCards) Observable.mergeDelayError(
.mergeWith(getNewArticlesPage) arrayListOf(
.mergeWith(fetchSubscription) restoreStateObservable,
.mergeWith(onSubChecked) prefetchCards,
.doOnError { Timber.e(it) } getNewArticlesPage,
.onErrorReturn(::parseError) fetchSubscription,
onSubChecked)
)
.doOnError { Timber.e(it) }
.onErrorReturn(::parseError)
// .mergeWith(prefetchCards)
// .mergeWith(getNewArticlesPage)
// .mergeWith(fetchSubscription)
// .mergeWith(onSubChecked)
// val safeState = Observable.mergeDelayError {
//
// }
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .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