UNPKG

739 BJavaScriptView Raw
1/* eslint-disable no-console */
2var _warningCallback = undefined;
3/**
4 * Sends a warning to console, if the api is present.
5 *
6 * @public
7 * @param message - Warning message.
8 */
9export function warn(message) {
10 if (_warningCallback && process.env.NODE_ENV !== 'production') {
11 _warningCallback(message);
12 }
13 else if (console && console.warn) {
14 console.warn(message);
15 }
16}
17/**
18 * Configures the warning callback. Passing in undefined will reset it to use the default
19 * console.warn function.
20 *
21 * @public
22 * @param warningCallback - Callback to override the generated warnings.
23 */
24export function setWarningCallback(warningCallback) {
25 _warningCallback = warningCallback;
26}
27//# sourceMappingURL=warn.js.map
\No newline at end of file