Skip to content

Instantly share code, notes, and snippets.

@skydoves
Created August 9, 2024 04:37
Show Gist options
  • Save skydoves/5a346eb0083becc9ced98b6d222cff96 to your computer and use it in GitHub Desktop.
Save skydoves/5a346eb0083becc9ced98b6d222cff96 to your computer and use it in GitHub Desktop.
local_inspection_mode
@Composable
fun UserProfiles(viewModel: UserViewModel) {
val users by if (LocalInspectionMode.current) {
remember { mutableStateOf(MockUtils.mockUsers) }
} else {
viewModel.users.collectAsStateWithLifecycle()
}
LazyColumn {
items(users) { user ->
..
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment