Robert Munro
03/29/2024, 2:13 PMUiComponent interface with create() and destory() methods. So now i want to create an essenty lifecycle object that i can pass to my Controller and i can manually call state changes from the create and destroy methods. Is there some prebuilt object in essenty that I can use for this or how would i implement one?Arkadii Ivanov
03/29/2024, 2:25 PMRobert Munro
03/29/2024, 3:41 PMclass RemotesUiComponent:UiComponent{
// the mvi controller
private val controller: RemotesController by scope.inject()
private val lifecycle = LifecycleRegistry()
override fun create() {
lifecycle.onCreate()
lifecycle.onStart()
lifecycle.onResume()
}
override fun destroy() {
lifecycle.onPause()
lifecycle.onStop()
lifecycle.onDestroy()
scope.close()
}
}
and i just pass in lifecycle to my remotes controller via injection?Arkadii Ivanov
03/29/2024, 4:31 PMRobert Munro
03/29/2024, 4:32 PM