Skip to content

Instantly share code, notes, and snippets.

@catalinghita8
Last active July 6, 2021 07:27
Show Gist options
  • Save catalinghita8/737f00a0357a6987e2a7ea8627c39306 to your computer and use it in GitHub Desktop.
Save catalinghita8/737f00a0357a6987e2a7ea8627c39306 to your computer and use it in GitHub Desktop.
@Composable
private fun FoodApp() {
val viewModel: FoodCategoriesViewModel = viewModel()
val state = viewModel.viewState.value
FoodCategoriesScreen(
state = state,
effectFlow = viewModel.effect,
onEventSent = { event -> viewModel.setEvent(event) },
onNavigationRequested = { navigationEffect ->
if (navigationEffect is FoodCategoriesContract.Effect.Navigation.ToCategoryDetails) {
// navigate
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment