1.1.0 • Published 4 years ago

swree v1.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

swrée

Bundles these in <9kB to be used without a build step:

Usage

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>

Demo

yarn demo then open http://localhost:5000/example

License

MIT

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago