Created
June 26, 2021 08:37
-
-
Save orcchg/71e6a736f3c9ee9410f81e9e5f24e114 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class App : Application(), ApiContainer { | |
@Inject | |
@FeatureApis | |
lateinit var featuresMap: Map<Class<*>, @JvmSuppressWildcards Api> | |
@Suppress("Unchecked_Cast") | |
override fun <T> getFeature(key: Class<T>): T = | |
featuresMap[key] as T | |
override fun onCreate() { | |
DaggerAppComponent.factory() | |
.create() | |
.inject(this) | |
super.onCreate() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment