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

implementing Viewmodel #656

Open
johnjeremih opened this issue Aug 18, 2021 · 2 comments
Open

implementing Viewmodel #656

johnjeremih opened this issue Aug 18, 2021 · 2 comments

Comments

@johnjeremih
Copy link

This is not an issue, but I would like to know how to implement ViewModel using conductor Controller. it doesn't extend from activity nor fragment, is there a way to do it? thanks

@hijamoya
Copy link

Use this library https://github.com/FunnyDevs/hilt-conductor.

    private val viewModel by lazy {
        ViewModelProvider(
            this,
            viewModelFactory { ViewModel(repository) }
        ).get(ViewModel::class.java)
    }

@johnjeremih
Copy link
Author

@hijamoya Do you have an example where you used it? Thanks

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

2 participants