useChatMessageActions
The purpose of useChatMessageActions
hook is to abstract out our store actions and exposes actions handlers responsible for updating store value.
Example usage
const { sendChatMessage, deleteChatMessage } = useChatMessageActions({
roomId: "<Room ID>"
});
Hook Argument
roomId
roomId
Type | Default |
---|---|
String (Required) | No Default |
Hook Return Value
sendChatMessage
sendChatMessage
Type |
---|
Function of type: (messageArgs: ISendMessageArgs) => Promise |
deleteChatMessage
deleteChatMessage
Type |
---|
Function of type: ({ roomId, chatMessage }: { roomId: any; chatMessage: any; }) => void |
Updated 12 months ago
What’s Next