Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to inject SavedStateHandle with hilt? #660

Open
Kilnn opened this issue Oct 27, 2022 · 0 comments
Open

How to inject SavedStateHandle with hilt? #660

Kilnn opened this issue Oct 27, 2022 · 0 comments

Comments

@Kilnn
Copy link

Kilnn commented Oct 27, 2022

class AuthCodeViewModel @AssistedInject constructor(
    @Assisted initState: AuthCodeState,
    savedStateHandle: SavedStateHandle
) : MavericksViewModel<AuthCodeState>(initState) {

    @AssistedFactory
    interface Factory : AssistedViewModelFactory<AuthCodeViewModel, AuthCodeState> {
        override fun create(state: AuthCodeState): AuthCodeViewModel
    }

    companion object : MavericksViewModelFactory<AuthCodeViewModel, AuthCodeState> by hiltMavericksViewModelFactory()
}

It is not working!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant