Skip to content

Instantly share code, notes, and snippets.

@arnaudgiuliani
Created March 2, 2018 17:22
Show Gist options
  • Select an option

  • Save arnaudgiuliani/f4d1ce24f768a16020aa23ccce3a21ff to your computer and use it in GitHub Desktop.

Select an option

Save arnaudgiuliani/f4d1ce24f768a16020aa23ccce3a21ff to your computer and use it in GitHub Desktop.
Koin 0.9.0 - Dynamic parameter setup
class DetailPresenter(val view : DetailContract.View) : DetailContract.Presenter {
override fun getDetail(id: String) {
// Get detail and notify it to view ...
}
}
val appModule = applicationContext {
// Presenter for Detail View
factory { params -> DetailPresenter(params["DETAIL_ACTIVITY"]) as DetailContract.Presenter }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment