Last active
December 23, 2017 16:25
-
-
Save yayaa/15f1cc8b09b2b1fbbac14e32ab6a79d6 to your computer and use it in GitHub Desktop.
ComponentDispatcher - 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SampleApplication : Application() { | |
private lateinit var componentDispatcher: ComponentDispatcher | |
override fun onCreate() { | |
super.onCreate() | |
componentDispatcher = ComponentDispatcher(this) | |
} | |
fun getComponentDispatcher() = componentDispatcher | |
} | |
// A nice extension property :) | |
val Activity.componentDispatcher: ComponentDispatcher | |
get() = (this.application as SampleApplication).getComponentDispatcher() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment