@openshift-console/dynamic-plugin-sdk
Version:
Provides core APIs, types and utilities used by dynamic plugins at runtime.
8 lines (7 loc) • 312 B
JavaScript
import { useSelector } from 'react-redux';
/**
* Hook that returns the given feature flag from FLAGS redux state.
* @param flag The feature flag to return
* @returns the boolean value of the requested feature flag or undefined
*/
export const useFlag = (flag) => useSelector(({ FLAGS }) => FLAGS.get(flag));