Counter
<script>
import { $memo, $signal } from 'brumate/signals';
let count = $signal(0);
const double = $memo(count * 2);
</script>
<div class="demo-counter">
<button onClick=(() => count++)>Clicked {count} times</button>
<p>Double: {double}</p>
<p class="note">This paragraph never changes, so it ships as HTML only.</p>
</div>| Module | Holds | gzip |
|---|---|---|
entry | the tables of the component | 0.23 KB |
The page loads 0.23 KB of this component when it starts, in its bundle. 3 elements ship as HTML only.
h2: event button.clickruns on the event