RocketChat/Rocket.Chat

View on GitHub
apps/meteor/client/views/admin/permissions/hooks/useRole.ts

Summary

Maintainability
A
0 mins
Test Coverage
import type { IRole } from '@rocket.chat/core-typings';
import { useCallback } from 'react';

import { Roles } from '../../../../../app/models/client';
import { useReactiveValue } from '../../../../hooks/useReactiveValue';

export const useRole = (_id?: IRole['_id']): IRole | undefined => useReactiveValue(useCallback(() => Roles.findOne({ _id }), [_id]));