Skip to content

Latest commit

 

History

History
27 lines (21 loc) · 628 Bytes

README.md

File metadata and controls

27 lines (21 loc) · 628 Bytes

FunE

Functional Element

Forget about boring objects and HTML. Build scalable web pages with declarative functions.

Example

Counter

import { E, signal } from "fune";

export const Counter = () => {
  const count = signal(0);
  const increase = () => (count.value = count.value + 1);
  const decrease = () => (count.value = count.value - 1);

  return E("div", {}, [
    E("h1", {}, ["Counter"]),
    E("p", {}, ["Count: ", count]),
    E("button", { onclick: increase }, ["Increment"]),
    E("button", { onclick: decrease }, ["Decrement"]),
  ]);
};