bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/audio/audio-graphql/hooks/useVoiceUsers.ts

18 lines
514 B
TypeScript

import { VOICE_USERS_SUBSCRIPTION, VoiceUsersResponse } from '../queries';
import createUseSubscription from '/imports/ui/core/hooks/createUseSubscription';
type Voice = VoiceUsersResponse['user_voice'][number];
const useVoiceUsersSubscription = createUseSubscription<Voice>(
VOICE_USERS_SUBSCRIPTION,
{},
true,
);
const useVoiceUsers = (projection: (v: Partial<Voice>) => Partial<Voice>) => {
const response = useVoiceUsersSubscription(projection);
return response;
};
export default useVoiceUsers;