Skip to content

Instantly share code, notes, and snippets.

@tfcporciuncula
Created February 29, 2024 12:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tfcporciuncula/f0c3be135d06b9df17a6168be31eb2d3 to your computer and use it in GitHub Desktop.
Save tfcporciuncula/f0c3be135d06b9df17a6168be31eb2d3 to your computer and use it in GitHub Desktop.
@HiltViewModel(assistedFactory = MyViewModel.Factory::class)
class MyViewModel @AssistedInject constructor(
@Assisted val runtimeArg: String,
// other dependencies
) : ViewModel() {
@AssistedFactory interface Factory {
fun create(runtimeArg: String): MyViewModel
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment