Skip to content

Instantly share code, notes, and snippets.

@skydoves
Created September 19, 2024 16:41
Show Gist options
  • Save skydoves/060f4ecda09974918b2c45abf51fe0ce to your computer and use it in GitHub Desktop.
Save skydoves/060f4ecda09974918b2c45abf51fe0ce to your computer and use it in GitHub Desktop.
DetailsViewModel
@Composable
fun PokedexDetails(
// SavedStateHandle with the argument "pokemon" will be injected
detailsViewModel: DetailsViewModel = hiltViewModel(),
) {
..
}
@HiltViewModel
class DetailsViewModel @Inject constructor(
savedStateHandle: SavedStateHandle,
) : ViewModel() {
..
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment