UNPKG

@bigfishtv/cockpit

Version:

41 lines (36 loc) 721 B
"use strict"; exports.__esModule = true; exports.add = add; exports.addAll = addAll; exports.resolve = resolve; /** * @module Core/tableCellRegistry */ var components = {}; /** * Add table cell component to registry * @param {String} alias * @param {React.Component} component */ function add(alias, component) { components[alias] = component; } /** * Add multiple table cell components to registry * @param {Object} obj */ function addAll(obj) { for (var key in obj) { if (obj.hasOwnProperty(key)) { add(key, obj[key]); } } } /** * Get table cell component from registry * @param {String} alias * @return {React.Component} */ function resolve(alias) { return components[alias]; }