Hello guys, I’m totally new to koin, not even sure...
# koin
a
Hello guys, I’m totally new to koin, not even sure if it’s the proper tool which can assist me in getting shared (singleton?) android ViewModel with arguments. Can you give me some idea how to get a ViewModel(arg1, arg2) as singleton?
j
take a look at https://insert-koin.io/docs/2.0/documentation/koin-android/index.html#_shared_viewmodel the
by sharedViewModel()
will allow you to have the shared instance and you can add variables into the constructor
a
oh, great! thank you for sharing
wow! so easy! awesome…
a
👍