Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

0.0.36

Choose a tag to compare

@ihasq ihasq released this 05 Jan 02:04
· 216 commits to main since this release

Added:

  • Post-processing: get raw element ref with id properties and callbacks.
function Canvas() {

    const colorSwitch = $(true);

    return html`
        <canvas ${{ id: "color", [on.click]: () => colorSwitch.switch() }}></canvas>

    `.then(({ color }) => {

        const ctx = color.getContext("2d");
        colorSwitch.into($ => $ ? "red" : "blue").watch($ => {
            ctx.fillStyle = $;
            ctx.fillRect(0, 0, 100, 100);
        });
    })
}