|
Download wp-calypso/packages/create-calypso-config/README.md from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 907 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/create-calypso-config/README.md
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/packages/create-calypso-config/README.md
-
curl -L -o README.md https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/create-calypso-config/README.md
907 Bytes
| # 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. | |
| ```js | |
| const value = config( key ); | |
| ``` | |
| ### config.isEnabled( key ) | |
| Is a feature enabled? | |
| ```js | |
| if ( config.isEnabled( 'myFeature' ) ) { | |
| // do something only when myFeature is enabled | |
| } | |
| ``` | |
| ### config.enabledFeatures() | |
| Gets the list of enabled features. | |
| ```js | |
| const enabledFeatures = config.enabledFeatures(); | |
| ``` | |
| ### config.enable( key ) | |
| Enable a feature. | |
| ```js | |
| config.enable( 'myFeature' ); | |
| ``` | |
| ### config.disable( key ) | |
| Disable a feature. | |
| ```js | |
| config.disable( 'myFeature' ); | |
| ``` | |