kohesive / injekt

Dependency Injection for Kotlin
MIT License
235 stars 19 forks source link

Custom scopes, example of propagating the custom scope to other classes #32

Open apatrida opened 8 years ago

apatrida commented 8 years ago

Add example to docs or example application, where a scope is propagated to other classes.

See example written as test case of this: https://github.com/kohesive/injekt/blob/master/core/src/test/kotlin/uy/kohesive/injekt/TestInjektion.kt#L202-L247

Which uses LocalScoped(see implementation)

And uses scoped factory registrations (see implementation)

apatrida commented 8 years ago

related: http://stackoverflow.com/questions/35315548/in-the-injekt-library-for-kotlin-how-do-i-create-local-scopes-such-as-for-each