2020-06-05 19:13:51 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
2024-05-24 12:13:24 +00:00
|
|
|
import { getSetting } from '@woocommerce/settings';
|
2020-06-05 19:13:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
2024-05-29 14:50:09 +00:00
|
|
|
import { WcBlocksConfig } from './constants';
|
2020-06-05 19:13:51 +00:00
|
|
|
|
|
|
|
/**
|
2024-05-24 12:13:24 +00:00
|
|
|
* Checks if experimental blocks are enabled.
|
|
|
|
*
|
|
|
|
* @return {boolean} True if this experimental blocks are enabled.
|
2020-06-05 19:13:51 +00:00
|
|
|
*/
|
2024-05-24 12:13:24 +00:00
|
|
|
export const isExperimentalBlocksEnabled = (): boolean => {
|
|
|
|
const { experimentalBlocksEnabled } = getSetting( 'wcBlocksConfig', {
|
|
|
|
experimentalBlocksEnabled: false,
|
|
|
|
} ) as WcBlocksConfig;
|
2020-06-05 19:13:51 +00:00
|
|
|
|
2024-05-24 12:13:24 +00:00
|
|
|
return experimentalBlocksEnabled;
|
2020-06-05 19:13:51 +00:00
|
|
|
};
|