Skip to content

Instantly share code, notes, and snippets.

@yayaa
Last active December 23, 2017 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yayaa/15f1cc8b09b2b1fbbac14e32ab6a79d6 to your computer and use it in GitHub Desktop.
Save yayaa/15f1cc8b09b2b1fbbac14e32ab6a79d6 to your computer and use it in GitHub Desktop.
ComponentDispatcher - 3
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