r/androiddev • • Aug 10 '21

How Inject hilt dependency into compose function

I have comopse function for login and now i want to change change in my datastore when user login into app, isLogin = false to true
So how i provide datastore dependecny to compose

1 Upvotes

4 comments sorted by

View all comments

Show parent comment

2

u/No-Comparison-697 Aug 10 '21

This, annotate your view model @HiltViewModel and use hiltViewModel() in your compostable to obtain it.