Clear cache on changing the threads FF (#4581)

* clear cache on changing the threads FF

# Conflicts:
#	PreviewTests/Sources/__Snapshots__/PreviewTests/labsScreen.iPad-pseudo-0.png
#	PreviewTests/Sources/__Snapshots__/PreviewTests/labsScreen.iPhone-16-pseudo-0.png

* fix tests
This commit is contained in:
Mauro
2025-10-07 11:38:58 +02:00
committed by GitHub
parent efef9ad335
commit 1a5ff8b012
11 changed files with 80 additions and 26 deletions
@@ -14,14 +14,35 @@ struct LabsScreenCoordinatorParameters {
let appSettings: AppSettings
}
enum LabsScreenCoordinatorAction {
case clearCache
}
final class LabsScreenCoordinator: CoordinatorProtocol {
private let viewModel: LabsScreenViewModelProtocol
private let actionsSubject: PassthroughSubject<LabsScreenCoordinatorAction, Never> = .init()
var actions: AnyPublisher<LabsScreenCoordinatorAction, Never> {
actionsSubject.eraseToAnyPublisher()
}
private var cancellables = Set<AnyCancellable>()
init(parameters: LabsScreenCoordinatorParameters) {
viewModel = LabsScreenViewModel(labsOptions: parameters.appSettings)
}
func start() { }
func start() {
viewModel
.actionsPublisher
.sink { [weak self] action in
switch action {
case .clearCache:
self?.actionsSubject.send(.clearCache)
}
}
.store(in: &cancellables)
}
func toPresentable() -> AnyView {
AnyView(LabsScreen(context: viewModel.context))