refactor: dynamic names

This commit is contained in:
cha0s 2024-08-04 23:08:41 -05:00
parent 4378ef2a12
commit c1a090688e

View File

@ -6,9 +6,13 @@ const Gathered = gather(
const Components = {}; const Components = {};
for (const componentName in Gathered) { for (const componentName in Gathered) {
Components[componentName] = class Named extends Gathered[componentName] { Components[componentName] = eval(`
static componentName = componentName; ((Gathered) => (
}; class ${componentName} extends Gathered['${componentName}'] {
static componentName = '${componentName}';
}
))
`)(Gathered);
} }
export default Components; export default Components;