Rocket.Chat.ReactNative/app/lib/hooks/useSetting.ts

7 lines
277 B
TypeScript
Raw Normal View History

import { TSettingsValues, TSupportedSettings } from '../../reducers/settings';
import { useAppSelector } from './useAppSelector';
export function useSetting(key: TSupportedSettings): TSettingsValues {
return useAppSelector(state => state.settings[key]) as TSettingsValues;
}