I'm building my app in Jetpack Compose and use one ViewModel for every feature/screen. Now I need to access the login state from everywhere inside the app, I also have a coin system where I need access to from every screen.
How do I accomplish this? My first idea was to put the login state and coin state inside a "MainViewModel" and then use this in every Screen for example in my "SettingsScreen" composable use "SettingsViewModel" and "MainViewModel". But I'm not sure if this is a good practice to use two viewModels in one screen.
How can I have access to the Login state and the Coins in every screen?