Files
featherVoice/TUIKit/TUIRoomKit/Source/Common/Components/FloatChat/Store/FloatChatEffect.swift
2025-08-08 10:49:36 +08:00

22 lines
562 B
Swift

//
// FloatChatEffect.swift
// TUIRoomKit
//
// Created by CY zhao on 2024/5/14.
//
import Foundation
class FloatChatEffect: Effects {
typealias Environment = FloatChatService
let sendMessage = Effect<Environment>.dispatchingOne { actions, environment in
actions.wasCreated(from: FloatChatActions.sendMessage)
.flatMap { action in
environment.sendGroupMessage(action.payload)
.map { FloatChatActions.onMessageSended(payload: $0) }
}
.eraseToAnyPublisher()
}
}