stream-chat-react-native-core
Version:
The official React Native and Expo components for Stream Chat, a service for building chat applications
13 lines (9 loc) • 589 B
text/typescript
import { Channel, ChannelMemberResponse, EventTypes } from 'stream-chat';
import { useSelectedChannelState } from './useSelectedChannelState';
const selector = (channel: Channel) => channel.state.membership;
const keys: EventTypes[] = ['member.updated'];
export function useChannelMembershipState(channel: Channel): ChannelMemberResponse;
export function useChannelMembershipState(channel?: Channel): ChannelMemberResponse | undefined;
export function useChannelMembershipState(channel?: Channel) {
return useSelectedChannelState({ channel, selector, stateChangeEventKeys: keys });
}