The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/client/hooks/useUserPreference.js

8 lines
347 B

import { getUserPreference } from '../../app/utils/client';
import { useReactiveValue } from './useReactiveValue';
import { useUserId } from './useUserId';
export const useUserPreference = (key, defaultValue = undefined) => {
const userId = useUserId();
return useReactiveValue(() => getUserPreference(userId, key, defaultValue), [userId]);
};