diff --git a/EssentialApp/EssentialApp/SceneDelegate.swift b/EssentialApp/EssentialApp/SceneDelegate.swift index 063967d0..f174e256 100644 --- a/EssentialApp/EssentialApp/SceneDelegate.swift +++ b/EssentialApp/EssentialApp/SceneDelegate.swift @@ -92,10 +92,10 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { private func makeRemoteFeedLoaderWithLocalFallback() -> AnyPublisher, Error> { makeRemoteFeedLoader() + .receive(on: scheduler) .caching(to: localFeedLoader) .fallback(to: localFeedLoader.loadPublisher) .map(makeFirstPage) - .subscribe(on: scheduler) .eraseToAnyPublisher() } @@ -106,6 +106,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { (cachedItems + newItems, newItems.last) } .map(makePage) + .receive(on: scheduler) .caching(to: localFeedLoader) .subscribe(on: scheduler) .eraseToAnyPublisher() @@ -139,8 +140,8 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { httpClient .getPublisher(url: url) .tryMap(FeedImageDataMapper.map) + .receive(on: scheduler) .caching(to: localImageLoader, using: url) - .subscribe(on: scheduler) .eraseToAnyPublisher() }) .subscribe(on: scheduler)