Javascript
JavaScript
The Config object
Cosmos Web exposes a configuration object with a set of properties, that enables customization of some aspects of the Cosmos Web library.
Properties
Property | Type | Default | Description |
|---|---|---|---|
disableWarnings | boolean | false | Disable console warnings from Cosmos, like deprecation warnings. |

How to use
In a bundle
If you use a bundler, like webpack and rollup, you can directly import the config module, and set the desired value:
import { config as cosmosConfig } from '@cosmos/web';
cosmosConfig.disableWarnings = true;In the global window
The cosmos config is also available from the global window object, under cosmosConfig. Because it is not possible to determine if the config has already been instantiated, you need to test for it first and assign an empty object to it if it is not the case:
window.cosmosConfig = window.cosmosConfig || {};
window.cosmosConfig.disableWarnings = true;