Skip to content

Instantly share code, notes, and snippets.

@Zhuinden
Created June 19, 2020 00:50
Show Gist options
  • Save Zhuinden/57fdc35430655126409fcca8d5d3c601 to your computer and use it in GitHub Desktop.
Save Zhuinden/57fdc35430655126409fcca8d5d3c601 to your computer and use it in GitHub Desktop.
Hilt LoginViewModel
class LoginViewModel @ViewModelInject constructor(
private val navigationDispatcher: NavigationDispatcher,
@Assisted private val savedStateHandle: SavedStateHandle
) : ViewModel() {
fun onRegisterClicked() {
navigationDispatcher.emit { navController ->
navController.navigate(R.id.logged_out_to_registration)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment