Files
new-phone-who-dis/phone/src/apps/example/hooks/useExampleService.ts
T
2021-04-07 19:07:10 -03:00

13 lines
406 B
TypeScript

import { useNuiEvent } from 'fivem-nui-react-lib';
import { useSetRecoilState } from 'recoil';
import { exampleState } from './state';
import { useExample } from './useExample';
export const useExampleService = () => {
const setExample = useSetRecoilState(exampleState.example);
useNuiEvent('EXAMPLE', 'setExample', setExample);
return useExample();
};
// call this function in the Phone.tsx file.