File "use-feature-flag.js"
Full Path: /home/siazco/grocery.siazco.se/wp-content/plugins/better-wp-security/core/packages/hocs/src/use-feature-flag.js
File size: 333 bytes
MIME-type: text/x-java
Charset: utf-8
/**
* WordPress dependencies
*/
import { useSelect } from '@wordpress/data';
/**
* Internal dependencies
*/
import { coreStore } from '@ithemes/security.packages.data';
export default function useFeatureFlag( flag ) {
return useSelect(
( select ) => select( coreStore ).getFeatureFlags()?.includes( flag ),
[ flag ]
);
}