https://kotlinlang.org logo
#kodein
Title
s

salomonbrys

11/05/2015, 3:50 PM
Copy code
val appModule = Kodein.Module {
  bind<EventBus>() with singleton { EventBus.getDefault() }
}

class MyApp: Application() {
  val components = Kodein {
    import(appModule)
  }
}

class MyActicity {
  val module = Kodein.Module {
    bind<MyActivity.Presenter>() with singleton { MyActivity.Presenter(instance()) } 
  }
  val components = Kodein {
    import(appModule)
    import(module)
  }
}