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

addClassNames could return the element itself #55

Open
dyoxyne opened this issue Feb 17, 2016 · 1 comment
Open

addClassNames could return the element itself #55

dyoxyne opened this issue Feb 17, 2016 · 1 comment
Labels

Comments

@dyoxyne
Copy link

dyoxyne commented Feb 17, 2016

It could be nice if addClassNames could return the element itself.

btnCreate = row.appendChild(new Button('CREATE')).addClassNames('col-lg-3');

@ronkorving
Copy link

Agreed, the code above currently wouldn't work, because addClassNames doesn't return the created button. So people often end up passing class names to constructors instead (to keep the call-site short). The extra code in the constructor is useless, and it doesn't really make the user APIs any cleaner.

@micky2be micky2be added the ready label Jun 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants