owncast/web/components/stores/eventhandlers/handleChatMessage.ts
2022-05-03 13:01:50 -07:00

11 lines
337 B
TypeScript

import { ChatMessage } from '../../../interfaces/chat-message.model';
import { ChatEvent } from '../../../interfaces/socket-events';
export default function handleChatMessage(
message: ChatEvent,
messages: ChatMessage[],
setChatMessages,
) {
const updatedMessages = [...messages, message];
setChatMessages(updatedMessages);
}