I'm trying to migrate from version 3.0.0 that used conductor-rxlifecycle
to version 3.1.4 that is using conductor-archlifecycle
and conductor-autodispose
.
my current code has extension functions that binds to the lifecycle - and I'm trying to understand what is the code change needed to adjust it to archlifecycle and auto-dispose.
I would appreciate some help here - couldn't figure it out from the demo code.
protected fun <C : RxController> Completable.bindToController(controller: C): Completable =
observeOn(AndroidSchedulers.mainThread()).compose(controller.bindToLifecycle<Any>())
protected fun <C : RxController> Completable.bindUntil(controller: C, event: ControllerEvent): Completable =
observeOn(AndroidSchedulers.mainThread()).compose(controller.bindUntilEvent<Any>(event))
I assume that the controller type should be LifecycleController
instead of RxController
, but I don't understand what is the replacement of bindToLifecycle
I opened this issue , but I'm trying to get some help here as well
This is the change I did to my code to match the new Conductor version:
The 2 functions above were replaced by this function:
Note that the return type is now
CompletableSubscribeProxy
and notCompletable
so the location of the call in the chain might need to be changed.I create different scopes:
And this is how
getScopeProvider
looks