WebReflection / hyperHTML

A Fast & Light Virtual DOM Alternative
ISC License
3.07k stars 112 forks source link

Property binding #138

Closed oliverjanik closed 6 years ago

oliverjanik commented 6 years ago

Apologies if this already exists but it would be cool if hyperHTML could perform property set instead of setAttribute.

See the tests here: https://custom-elements-everywhere.com/

oliverjanik commented 6 years ago

My apologies, the following works and uses my defined properties:

return hh.bind(this)`
<main>
    ${this.entries.map(e => hh.wire(e)`<ch-entry entry="${e}"></ch-entry>`)}
</main>`;

Where <ch-entry> is my custom element with entry setter defined. Rather cool!

Now question remains why is above test showing 26/30?

WebReflection commented 6 years ago

Because they are using a broken version.

You should test latest before filing bugs ;-)

oliverjanik commented 6 years ago

Andrea, I did test as you can see from the above post. In my version I was missing wire() inside the map and was returning just a string.

I posted the working version for posterity if anyone comes across this. (Google is very good at indexing Github issues)

Also submitted an issue here: https://github.com/webcomponents/custom-elements-everywhere/issues/112