Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arguments as an object #63

Open
shapkarin opened this issue Jan 8, 2019 · 1 comment
Open

Arguments as an object #63

shapkarin opened this issue Jan 8, 2019 · 1 comment

Comments

@shapkarin
Copy link
Collaborator

shapkarin commented Jan 8, 2019

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
Copy link
Contributor

Yes, this is a good refactoring idea! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants