Skip to content

Instantly share code, notes, and snippets.

@itsandreramon
Last active December 27, 2023 08:31
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 itsandreramon/97a8172795440bcfffb70d8eb8ef108a to your computer and use it in GitHub Desktop.
Save itsandreramon/97a8172795440bcfffb70d8eb8ef108a to your computer and use it in GitHub Desktop.
@SingleIn(AppScope::class)
class UserSessionManager @Inject constructor(private val app: App) {
var userComponent: UserComponent? = null
private set
fun resetSession() {
userComponent = null
}
fun createSession(id: String) {
val session = UserSession(id)
userComponent = app.appComponent
.userComponentFactory()
.create(session)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment