You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

19 lines
461 B

import Todo
class ComponentHolder<T> {
let lifecycle: LifecycleRegistry
let component: T
init(factory: (ComponentContext) -> T) {
let lifecycle = LifecycleRegistryKt.LifecycleRegistry()
let component = factory(DefaultComponentContext(lifecycle: lifecycle))
self.lifecycle = lifecycle
self.component = component
lifecycle.onCreate()
}
deinit {
lifecycle.onDestroy()
}
}