another.im-ios/ConversationsClassic/AppCore/Middlewares/RostersMiddleware.swift

17 lines
470 B
Swift
Raw Normal View History

2024-06-19 15:15:27 +00:00
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()
}
}
}