import { signal, computed } from "@preact/signals"; const count = signal(0); const double = computed(() => count.value * 2); function Counter() { return ( <button onClick={() => count.value++}> {count} x 2 = {double} </button> ); }
https://twitter.com/floydophone/status/1629009165422104576?t=iXcnvjicv0Phb9lsTWsbBg&s=19