refactor: dynamic names
This commit is contained in:
parent
4378ef2a12
commit
c1a090688e
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user