View Model Creation in Jetpack Compose

2 ways (by viewModels and viewModel() composable function) to create view model in your Jetpack compose app

by viewModels

class MainActivity 

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store