99x / react-scaffolder

:zap: Scaffolding tool for React
MIT License
44 stars 14 forks source link

Arguments as an object #63

Open shapkarin opened 5 years ago

shapkarin commented 5 years ago

I think that it would be better to use object as argument. instead of

generate.prototype.createComponent = function(
    module,
    componentName,
    answers,
    answersInner,
    onlyFile, 
    cb
) {}

better is

generate.prototype.createComponent = function({
    module,
    componentName,
    answers,
    answersInner = null,
    onlyFile = false, 
    cb
}) {}

And later use that:

generate.createComponent({
    module: modulename,
    componentName: name,
    cb: function(status) {}
});
rajikaimal commented 5 years ago

Yes, this is a good refactoring idea! 🎉