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

24 lines
578 B
TypeScript
Raw Normal View History

import { useCallback } from 'react';
import { useMutation } from '@apollo/client';
import { USER_SET_SPEECH_OPTIONS } from '../mutations';
const useSetSpeechOptions = () => {
const [userSetSpeechOptions] = useMutation(USER_SET_SPEECH_OPTIONS);
const setSpeechOptions = (
partialUtterances: boolean,
minUtteranceLength: number,
) => {
userSetSpeechOptions({
variables: {
partialUtterances,
minUtteranceLength,
},
});
};
return useCallback(setSpeechOptions, [userSetSpeechOptions]);
};
export default useSetSpeechOptions;