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

Add elements support #2

Open
mrozbarry opened this issue Jul 9, 2015 · 0 comments
Open

Add elements support #2

mrozbarry opened this issue Jul 9, 2015 · 0 comments

Comments

@mrozbarry
Copy link

It is a pain to re-type a set of elements if they are being used frequently, ie:

bem = new Bemmer({block: 'my-block'})

MyComponent className: bem.with({element: 'my-component'}),
  MySubComponent className: bem.with({element: 'my-component-child'})
  MySubComponent2 className: bem.with({element: 'my-component-child2'})

Why not allow the following syntax?

bem = new Bemmer({block: 'my-block'})
elems = ['my-component']

MyComponent className: bem.with({elements: elems}),
  MySubComponent className: bem.with({elements: elems.concat('child')})
  MySubComponent2 className: bem.with({elements: elems.concat('child2')})

With heavier nesting in a single component, this syntax could considerably reduce complexity, while sacrificing some readability.

Would this feature be useful to anyone?

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

No branches or pull requests

1 participant