stream-chat-react-native-core
Version:
The official React Native and Expo components for Stream Chat, a service for building chat applications
23 lines (21 loc) • 580 B
text/typescript
import { fromPartial } from '@total-typescript/shoehorn';
import type { ChannelResponse, Event, StreamChat, UserResponse } from 'stream-chat';
export default (
client: StreamChat,
channel: Partial<ChannelResponse> = {},
payload: Partial<Event> = {},
user: Partial<UserResponse> = {},
) => {
const newDate = new Date() as unknown as string;
client.dispatchEvent(
fromPartial<Event>({
channel,
cid: channel.cid,
created_at: newDate,
received_at: newDate,
type: 'notification.mark_unread',
user,
...payload,
}),
);
};