choojs / hyperx

🏷 - tagged template string virtual dom builder
BSD 2-Clause "Simplified" License
1.01k stars 48 forks source link

Multiple properties support #16

Closed JamesKyburz closed 8 years ago

JamesKyburz commented 8 years ago

In react you can use the spread operator like so

<Element {...this.props} />

Unfortunately

hx`<Element ${...this.props} />`

isn't valid... However I propose

hx`<Element ${this.props} />`

As no key is given this can be handled in the parse which this pull request handles (hopefully in an ok way)

I have written two tests for this new functionality.

ghost commented 8 years ago

This looks great, thanks! I was thinking of implementing the same feature I just hadn't gotten around to it.

I've added you as a maintainer in the spirit of open open source.

JamesKyburz commented 8 years ago

:) Great thx!