UNPKG

@appbuckets/react-ui-smart-components

Version:

UI Extended Components that work with @appbuckets/react-client and @appbuckets/react-ui

25 lines (22 loc) 688 B
'use strict'; var actionBuilt = new Map(); function assertUniqueComponentName(displayName, type) { /** Check components in development mode only */ if (process.env.NODE_ENV === 'development') { /** Get value */ var maybeType = actionBuilt.get(displayName); /** Show a warn if exists */ if (maybeType) { global.console.warn( '[ @appbuckets/react-ui-smart-components ] : a '.concat( maybeType, ' component has been ' ) + 'already built using displayName '.concat(displayName, '.') ); } else { /** Add the value */ actionBuilt.set(displayName, type); } } } module.exports = assertUniqueComponentName;