17 lines
470 B
Swift
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()
|
|
}
|
|
}
|
|
}
|