-
Notifications
You must be signed in to change notification settings - Fork 429
/
Copy pathfuture-property.js
28 lines (22 loc) · 970 Bytes
/
future-property.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */
/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
/* eslint-disable import/no-mutable-exports */
// This function will deliver an error message to the browser console that another component may use, but is not yet released.
import warning from 'warning';
let future = function futureFunction() {};
if (process.env.NODE_ENV !== 'production') {
const hasWarned = {};
future = function futureFunction(control, propValue, newProp, comment) {
const additionalComment = comment ? ` ${comment}` : '';
if (!hasWarned[control + newProp]) {
/* eslint-disable max-len */
warning(
!propValue,
`[Design System React] \`${newProp}\` of ${control} is not implemented yet. Please check future releases for \`${newProp}\`.${additionalComment}`
);
/* eslint-enable max-len */
hasWarned[control + newProp] = !!propValue;
}
};
}
export default future;