Skip to content

Instantly share code, notes, and snippets.

@Rasalexman
Created May 6, 2020 19:09
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 Rasalexman/7396a5b9195f86f79516b64cbcfed2ab to your computer and use it in GitHub Desktop.
Save Rasalexman/7396a5b9195f86f79516b64cbcfed2ab to your computer and use it in GitHub Desktop.
Getting the Kodi dependency from graph
// import
class MainActivity : AppCompatActivity(), IKodi {
val myAmazingClass: MyClass by immutableInstance() // 1.
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// or you can get instance directly from DI
val myInstance = instance<MyClass>() // 2.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment