Hybrids counter
by Carson Evans
HTML
<basic-counter count="10" />
JavaScript
import { define, html } from 'https://esm.sh/hybrids@^9';
function decreaseCount(host) {
host.count -= 1;
}
function increaseCount(host) {
host.count += 1;
}
define({
tag: 'basic-counter',
count: 0,
render: ({ count }) => html`
<button onclick=${decreaseCount}>-</button>
${count}
<button onclick=${increaseCount}>+</button>
`,
});