Skip to content

Instantly share code, notes, and snippets.

@hamadycisse
Created November 17, 2019 19:11
Show Gist options
  • Save hamadycisse/e72faa6308bff8a65678a33a931a8619 to your computer and use it in GitHub Desktop.
Save hamadycisse/e72faa6308bff8a65678a33a931a8619 to your computer and use it in GitHub Desktop.
class OurAppInjectionScopes(private val appComponent: AppComponent) : AppInjectionScopes {
override val isInUserScope: Boolean
get() = userScope != null
override var userScope: UserScopeSubcomponent? = null
private set
override fun openUserScope() {
userScope = appComponent.getUserScopeSubcomponentFactory().create()
}
override fun closeUserScope() {
userScope = userScope?.run {
notifier.dispose()
null
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment