[Injection] Annotate default services with @DefaultImplementation

This commit is contained in:
Dmitry Savvinov
2019-05-14 19:02:43 +03:00
parent d80eba31be
commit b631e89ea7
17 changed files with 56 additions and 84 deletions
@@ -46,6 +46,10 @@ fun StorageComponentContainer.useInstance(instance: Any) {
registerInstance(instance)
}
fun StorageComponentContainer.useInstanceIfNotNull(instance: Any?) {
if (instance != null) registerInstance(instance)
}
inline operator fun <reified T : Any> ComponentProvider.getValue(thisRef: Any?, desc: KProperty<*>): T {
return getService(T::class.java)
}