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?
It is a pain to re-type a set of elements if they are being used frequently, ie:
Why not allow the following syntax?
With heavier nesting in a single component, this syntax could considerably reduce complexity, while sacrificing some readability.
Would this feature be useful to anyone?