hey everyone, i want to have multiple viewmodel in...
# koin
k
hey everyone, i want to have multiple viewmodel instance of the same viewmodel class based on a key and want to retrieve those using the key, what the best way to achieve this?
a
Copy code
val viewModel1: ViewModelType = koinViewModel(key = key1)
val viewModel2: ViewModelType = koinViewModel(key = key2)
maybe something like this
k
key is for identification but it wont work if i go back and come again
a
Either use key or qualifier:
Going back make you loose your VM?