# ⚡ Quick API Reference SigPro is a high-performance micro-framework that updates the **Real DOM** surgically. No Virtual DOM, no unnecessary re-renders, and built-in **Cleanup** (memory cleanup).
| Function | Signature | Description |
|---|---|---|
$(val, key?) |
(any, string?) => Signal | Creates a Signal. If key is provided, it persists in localStorage. |
$(fn) |
(function) => Computed | Creates a Computed Signal that auto-updates when dependencies change. |
$$(obj) |
(object) => Proxy | Creates a Deep Reactive Proxy. Track nested property access automatically. No need for manual signals. |
Watch(fn) |
(function) => stopFn | Auto Mode: Tracks any signal touched inside. Returns a stop function. |
Watch(deps, fn) |
(Array, function) => stopFn | Explicit Mode: Only runs when signals in deps change. |
If(cond, then, else?) |
(Signal|bool, fn, fn?) => Node | Reactive conditional. Automatically destroys "else" branch memory. |
For(src, render, key) |
(Signal, fn, fn) => Node | Keyed Loop: Optimized list renderer. Uses the key function for surgical DOM moves. |
Router(routes) |
(Array) => Node | SPA Router: Hash-based routing with dynamic params (:id) and auto-cleanup. |
Mount(node, target) |
(any, string|Node) => Runtime | Entry point. Cleans the target and mounts the app with full lifecycle management. |
Tag({ attributes }, [children])
value: mySignal
Automatic sync for Input, Textarea, and Select. Updates the signal on 'input' or 'change'.
Router.to('/user/1')
Navigate programmatically. Access params via Router.params().id.
ref: (el) => ...
Get direct access to the DOM node once it is created.
onClick: (e) => ...
Standard events with automatic removeEventListener on destruction.