diff --git a/Frameworks/Feed/Bundle/Sources/Coordinators/FeedListCoordinator.swift b/Frameworks/Feed/Bundle/Sources/Coordinators/FeedListCoordinator.swift index e2ff456..2562825 100644 --- a/Frameworks/Feed/Bundle/Sources/Coordinators/FeedListCoordinator.swift +++ b/Frameworks/Feed/Bundle/Sources/Coordinators/FeedListCoordinator.swift @@ -34,7 +34,10 @@ public final class FeedListCoordinator: Coordinator { onDismiss: Router.OnDismissClosure? = nil ) { router.present( - FeedListViewController(.init(configuration: configuration)), + FeedListViewController(.init( + configuration: configuration, + coordination: self + )), animated: animated, onDismiss: onDismiss ) diff --git a/Frameworks/Feed/Bundle/Sources/Logic/View Models/FeedListViewModel.swift b/Frameworks/Feed/Bundle/Sources/Logic/View Models/FeedListViewModel.swift index fe33373..96ef07a 100644 --- a/Frameworks/Feed/Bundle/Sources/Logic/View Models/FeedListViewModel.swift +++ b/Frameworks/Feed/Bundle/Sources/Logic/View Models/FeedListViewModel.swift @@ -27,18 +27,24 @@ extension FeedListViewController { var items: [Review] = [] var words: [TopWord] = [] - + private var reviewsAll: [Review] = [] private var reviewsFiltered: FilteredReviews = [:] private var reviewsTopWords: TopWordsReviews = [:] + private weak var coordination: FeedListCoordination? + lazy private var iTunesService: iTunesService = { .init(configuration: .init(session: configuration.session)) }() // MARK: Initialisers - init(configuration: FeedListConfiguration = .init()) { + init( + configuration: FeedListConfiguration = .init(), + coordination: FeedListCoordination? = nil + ) { self.configuration = configuration + self.coordination = coordination } // MARK: Computed