This collection demonstrates three fundamental reactive programming patterns using vanilla JavaScript. These examples show the manual patterns that modern frameworks (React, Vue, Svelte) automate.
📖 Read Full DocumentationPattern: UI automatically reacts to state changes
Real-world analogy: A light that turns on only when ALL switches are flipped
Pattern: One value affects multiple outputs (one-to-many reactivity)
Real-world analogy: A spreadsheet where changing one cell recalculates all formulas
Pattern: Multiple inputs stay in sync - any one can be the source
Real-world analogy: Google Docs collaborative editing or mirrored form fields
| Example | Pattern | Direction | Use Case |
|---|---|---|---|
| Check Boxes | Derived state | One direction (data → UI) | Computing values from state |
| Multipliers | Computed dependencies | One-to-many | Shared state affecting multiple outputs |
| Synchro | Synchronized state | Bidirectional (peer-to-peer) | Keeping multiple inputs in sync |
These examples teach reactivity without framework magic - the core concepts that underpin:
Understanding these manual patterns makes it easier to understand what frameworks are doing under the hood.
📖 Read Full Documentation