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

18 lines
514 B
TypeScript
Raw Normal View History

2024-06-07 02:47:41 +08:00
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;