Master reactive state management with $state, $derived, and $effect
Each counter maintains its own reactive state using $state:
The $derived rune automatically recalculates when dependencies change:
1 + 2 + 3 + 4 = 10
Move your mouse over the area below to see reactive updates in real-time:
COORDINATES
0 × 0
The $effect rune runs code when dependencies change and handles cleanup:
ELAPSED TIME
0s
Interval: 1000ms