refactor: dynamic names
This commit is contained in:
parent
4378ef2a12
commit
c1a090688e
|
@ -6,9 +6,13 @@ const Gathered = gather(
|
|||
|
||||
const Components = {};
|
||||
for (const componentName in Gathered) {
|
||||
Components[componentName] = class Named extends Gathered[componentName] {
|
||||
static componentName = componentName;
|
||||
};
|
||||
Components[componentName] = eval(`
|
||||
((Gathered) => (
|
||||
class ${componentName} extends Gathered['${componentName}'] {
|
||||
static componentName = '${componentName}';
|
||||
}
|
||||
))
|
||||
`)(Gathered);
|
||||
}
|
||||
|
||||
export default Components;
|
||||
|
|
Loading…
Reference in New Issue
Block a user