Create Calypso Config
This package exports a single function which takes config data and returns the config object used around Calypso.
This was extracted from lib/create-config.
ConfigApi interface
The API returned by createConfig is as follows. It is a function extended with a handful of useful features-oriented functions.
config( key )
Returns the value for the given configuration key.
const value = config( key );
config.isEnabled( key )
Is a feature enabled?
if ( config.isEnabled( 'myFeature' ) ) {
}
config.enabledFeatures()
Gets the list of enabled features.
const enabledFeatures = config.enabledFeatures();
config.enable( key )
Enable a feature.
config.enable( 'myFeature' );
config.disable( key )
Disable a feature.
config.disable( 'myFeature' );