Tim Malseed
07/15/2022, 12:15 AMStoreListViewModel
and StoreDetailsViewModel
StoreList lets me retrieve a list of Store(val name: String, val lat: Double, val long: Double)
And StoreDetails renders some UI for a particular Store
.
There’s no real ‘identifier’ for a Store, though I could use the hashcode or something. And there’s currently no cache for Stores.
Where do I stash this Store object? I don’t particularly want to share the StoreList's
ViewModel
with the StoreDetails
screen, as it contains properties and functions that don’t relate to StoreDetails.
Do I create a 3rd ViewModel for sharing between the two screens, and set the Store on that VM?Carl Benson
07/15/2022, 7:54 AMTim Malseed
07/15/2022, 8:25 AMCarl Benson
07/15/2022, 8:48 AMIan Lake
07/15/2022, 2:58 PMTim Malseed
07/15/2022, 10:52 PMIan Lake
07/15/2022, 11:25 PMTim Malseed
07/15/2022, 11:57 PM