17 lines
433 B
JavaScript
17 lines
433 B
JavaScript
const defaultGenerator = componentName => componentName;
|
|
const createClassNameGenerator = () => {
|
|
let generate = defaultGenerator;
|
|
return {
|
|
configure(generator) {
|
|
generate = generator;
|
|
},
|
|
generate(componentName) {
|
|
return generate(componentName);
|
|
},
|
|
reset() {
|
|
generate = defaultGenerator;
|
|
}
|
|
};
|
|
};
|
|
const ClassNameGenerator = createClassNameGenerator();
|
|
export default ClassNameGenerator; |