stream-chat-react-native-core
Version:
The official React Native and Expo components for Stream Chat, a service for building chat applications
27 lines (25 loc) • 544 B
text/typescript
import { fromPartial } from '@total-typescript/shoehorn';
import type {
ChannelResponse,
Event,
LocalMessage,
MessageResponse,
ReactionResponse,
StreamChat,
} from 'stream-chat';
export default (
client: StreamChat,
reaction: ReactionResponse,
message: MessageResponse | LocalMessage,
channel: Partial<ChannelResponse> = {},
) => {
client.dispatchEvent(
fromPartial<Event>({
channel,
cid: channel.cid,
message: message as MessageResponse,
reaction,
type: 'reaction.new',
}),
);
};