@pyreon/reactivity 0.7.0 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -31,13 +31,14 @@ batch(() => {
|
|
|
31
31
|
|
|
32
32
|
### Signals
|
|
33
33
|
|
|
34
|
-
- **`signal<T>(initial: T): Signal<T>`** -- Callable getter with `.set(value)` and `.update(fn)` methods.
|
|
34
|
+
- **`signal<T>(initial: T, options?): Signal<T>`** -- Callable getter with `.set(value)` and `.update(fn)` methods. Pass `{ name }` for debug labels (auto-injected by `@pyreon/vite-plugin` in dev mode).
|
|
35
35
|
- **`computed<T>(fn, options?): Computed<T>`** -- Derived signal that recomputes lazily when dependencies change.
|
|
36
36
|
- **`cell<T>(initial: T): Cell<T>`** -- Lightweight reactive cell.
|
|
37
37
|
|
|
38
38
|
### Effects
|
|
39
39
|
|
|
40
40
|
- **`effect(fn): Effect`** -- Runs `fn` and re-runs it whenever its tracked dependencies change.
|
|
41
|
+
- **`onCleanup(fn)`** -- Registers a cleanup function inside an effect. Runs before re-execution and on disposal.
|
|
41
42
|
- **`renderEffect(fn): Effect`** -- Like `effect`, but scheduled for render timing.
|
|
42
43
|
- **`watch(source, callback, options?): WatchOptions`** -- Watches a reactive source and calls back on change.
|
|
43
44
|
- **`setErrorHandler(handler)`** -- Sets a global error handler for effect errors.
|