kgellci/Area51

Create ListingViewModel and convert FeedViewModel to use

Opened this issue · 0 comments

FeedViewModel has logic for formatting listings. It is doing this by mutating the Listing objects in place.

https://github.com/kgellci/Area51/blob/master/Area51/Sources/ViewModels/FeedViewModel.swift#L37

We should instead instantiate ListingViewModel from a listing which will apply the needed formatting to the required fields. We can probably convert ListingsDataSource to be a ListingViewModelDataSource which would give the added benefit of only formatting listings once instead of every time more listings are loaded.