Bundles these in <9kB to be used without a build step:
In a browser that supports modules, just use:
<script type="module">
import { h, html, render, useState } from 'https://unpkg.com/swree?module';
const Example = () => {
const [counter, setCounter] = useState(0);
const increment = () => setCounter(counter + 1);
const decrement = () => setCounter(counter - 1);
return html`<div>
<span>${counter}</span>
<button onClick=${increment}>+</button>
<button onClick=${decrement}>-</button>
</div>`;
};
render(h(Example), document.body);
</script>
yarn demo
then open http://localhost:5000/example
MIT