import Combine

final class TempMiddleware {
    static let shared = TempMiddleware()

    func middleware(state: AppState, action: AppAction) -> AnyPublisher<AppAction, Never> {
        switch action {
        case .tempAction(.dumb):
            return Just(AppAction.flushState)
                .eraseToAnyPublisher()

        default:
            return Empty().eraseToAnyPublisher()
        }
    }
}
