@pagamio/frontend-commons-lib
Version:
Pagamio library for Frontend reusable components like the form engine and table container
14 lines (13 loc) • 419 B
JavaScript
const InputRegistry = {};
// Register a new input component
export const registerInput = (type, component) => {
return (InputRegistry[type] = component);
};
// Retrieve an input component from the registry
export const getInputComponent = (type) => {
const component = InputRegistry[type];
if (!component) {
console.warn(`No input component found for type: ${type}`);
}
return component;
};