another.im-ios/old/AppCore/Middlewares/RostersMiddleware.swift
2024-08-11 13:09:29 +02:00

17 lines
470 B
Swift

import Combine
final class RostersMiddleware {
static let shared = RostersMiddleware()
func middleware(state _: AppState, action: AppAction) -> AnyPublisher<AppAction, Never> {
switch action {
case .databaseAction(.storedRostersLoaded(let rosters)):
return Just(.rostersAction(.rostersListUpdated(rosters)))
.eraseToAnyPublisher()
default:
return Empty().eraseToAnyPublisher()
}
}
}