Skip to content

Instantly share code, notes, and snippets.

@manuelvicnt
Created August 5, 2022 12:18
Show Gist options
  • Save manuelvicnt/4eef049f8440a6cb1d21b65055be9065 to your computer and use it in GitHub Desktop.
Save manuelvicnt/4eef049f8440a6cb1d21b65055be9065 to your computer and use it in GitHub Desktop.
/* Copyright 2022 Google LLC.
SPDX-License-Identifier: Apache-2.0 */
@OptIn(ExperimentalLifecycleComposeApi::class)
@Composable
fun AuthorRoute(
onBackClick: () -> Unit,
modifier: Modifier = Modifier,
viewModel: AuthorViewModel = hiltViewModel()
) {
val uiState: AuthorScreenUiState by viewModel.uiState.collectAsStateWithLifecycle()
AuthorScreen(
authorState = uiState.authorState,
newsState = uiState.newsState,
modifier = modifier,
onBackClick = onBackClick,
onFollowClick = viewModel::followAuthorToggle,
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment