stream-chat-react-native-core
Version:
The official React Native and Expo components for Stream Chat, a service for building chat applications
20 lines (16 loc) • 805 B
text/typescript
import { Channel, EventTypes, Mute, StreamChat } from 'stream-chat';
import { useChatContext } from '../../../contexts';
import { useSyncClientEvents } from '../../../hooks/useSyncClientEvents';
const selector = (client: StreamChat) => client.mutedUsers;
const keys: EventTypes[] = ['health.check', 'notification.mutes_updated'];
export function useMutedUsers(): Array<Mute>;
/**
*
* @param @deprecated _channel - This parameter is deprecated because it is no longer necessary. It is kept for backwards compatibility only.
* @returns
*/
export function useMutedUsers(_channel: Channel): Array<Mute> | undefined;
export function useMutedUsers(_channel?: Channel): Array<Mute> {
const { client } = useChatContext();
return useSyncClientEvents({ client, selector, stateChangeEventKeys: keys });
}