mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-01 00:11:59 +08:00
15 lines
389 B
TypeScript
15 lines
389 B
TypeScript
import _get from 'lodash-es/get';
|
|
import { useSelector } from 'react-redux';
|
|
import { AppState } from 'store/reducers';
|
|
import AppReducer from 'types/reducer/app';
|
|
|
|
const useFeatureFlag = (flagKey: string): boolean => {
|
|
const { featureFlags } = useSelector<AppState, AppReducer>(
|
|
(state) => state.app,
|
|
);
|
|
|
|
return _get(featureFlags, flagKey, false);
|
|
};
|
|
|
|
export default useFeatureFlag;
|