storeAndRemember

Deprecated

Does not work for configuration changes (e.g. rotation).

Replace with

import androidx.lifecycle.viewmodel.compose.viewModel
viewModel()

Stores and remembers a view model in the local ViewModelStore. Use if the view model was created manually and is not located in Activity/Fragment ViewModelStore. provider will only be evaluated during the composition. Recomposition will always return the value produced by provider.