Skip to content

Instantly share code, notes, and snippets.

@CostaFot
Last active May 13, 2024 22:44
Show Gist options
  • Save CostaFot/c148649eb01494d4929ac6549bb8d2c7 to your computer and use it in GitHub Desktop.
Save CostaFot/c148649eb01494d4929ac6549bb8d2c7 to your computer and use it in GitHub Desktop.
@Composable
fun FirstScreen(
navigate: () -> Unit,
firstContainer: FirstContainer = rememberFirstContainer(),
firstViewModel: FirstViewModel = viewModel(factory = firstContainer.viewModelFactory)
) { // content here.. }
@Composable
fun rememberFirstContainer(): FirstContainer {
return remember {
FirstContainer().also {
DaggerFirstComponent.builder().build().inject(it)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment