diff --git a/app/src/main/java/com/karumi/jetpack/superheroes/ui/Lifecycle.kt b/app/src/main/java/com/karumi/jetpack/superheroes/ui/Lifecycle.kt deleted file mode 100644 index f914318..0000000 --- a/app/src/main/java/com/karumi/jetpack/superheroes/ui/Lifecycle.kt +++ /dev/null @@ -1,36 +0,0 @@ -package com.karumi.jetpack.superheroes.ui - -val lifeCycleLinker = LifecycleLinker() - -class LifecycleLinker : LifecyclePublisher { - - private val receivers = ArrayList() - - override fun register(subscriber: LifecycleSubscriber) { - receivers.add(subscriber) - } - - override fun unregister(subscriber: LifecycleSubscriber) { - receivers.remove(subscriber) - } - - override fun update() { - receivers.forEach(LifecycleSubscriber::update) - } - - override fun initialize() { - receivers.forEach(LifecycleSubscriber::initialize) - } -} - -interface LifecyclePublisher { - fun initialize() - fun register(subscriber: LifecycleSubscriber) - fun unregister(subscriber: LifecycleSubscriber) - fun update() -} - -interface LifecycleSubscriber { - fun initialize() {} - fun update() {} -}