@bigfishtv/cockpit
Version:
35 lines (31 loc) • 629 B
JavaScript
/**
* @module Core/tableCellRegistry
*/
var components = {};
/**
* Add table cell component to registry
* @param {String} alias
* @param {React.Component} component
*/
export function add(alias, component) {
components[alias] = component;
}
/**
* Add multiple table cell components to registry
* @param {Object} obj
*/
export 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}
*/
export function resolve(alias) {
return components[alias];
}