Closed humblehacker closed 1 year ago
Thanks for looking into this!
I am afraid this approach won't work though. Once the ObservableViewModel
is deallocated the Kotlin ViewModel will be cleared, closing the CoroutineScope
.
Resulting in any subsequent page views to only contain static data, as can be seen with the TimeTravelViewModel
.
This however did make me think some more about the responsibilities.
Since the KMMViewModel
is keeping a reference to the child KMMViewModel
. It would be the responsibility of the Swift ObservableViewModel
of said KMMViewModel
to keep a reference to the ObservableViewModel
s of the child KMMViewModel
s.
Could you take a look at #41?
Closing this in favor of #41
Looks like
StateViewModel
needs the same fix.