@cplieger/reactive 1.2.1 → 1.2.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 +1 -1
- package/jsr.json +1 -1
- package/package.json +3 -3
- package/src/el.ts +1 -6
package/README.md
CHANGED
|
@@ -92,7 +92,7 @@ isComputed(doubled); // true
|
|
|
92
92
|
|
|
93
93
|
`createStore` and `SignalMap` are thin facades over the one signal engine — there is no second reactivity implementation. `createStore` lazily backs each key with a signal; `SignalMap` is a registry of signals keyed by a runtime string id.
|
|
94
94
|
|
|
95
|
-
- `createStore<M>(): Store<M>` — typed, fixed-key reactive store with `get`, `set`, `subscribe`, `effect`, `computed`, and `batch`. `subscribe` notifies on change only (not immediately on subscribe). A `computed` key whose fn reads its own output
|
|
95
|
+
- `createStore<M>(): Store<M>` — typed, fixed-key reactive store with `get`, `set`, `subscribe`, `effect`, `computed`, and `batch`. `subscribe` notifies on change only (not immediately on subscribe). A `computed` key whose fn reads its own output does not loop unbounded: a self-read that keeps yielding new values trips the engine's batch-iteration guard and surfaces `Error("Cycle detected")` through the effect error handler (effects isolate errors, so it is not rethrown to the caller), while a stable self-read settles via `Object.is` dedup.
|
|
96
96
|
- `SignalMap<V>` — dynamic per-id signal registry: `get(id)`, `ensure(id, initial)`, `clear(id)`, `clearAll()`. For reactive state whose key set isn't known at the type level (per-message streaming text, per-row state, …); complements `createStore`'s fixed key set.
|
|
97
97
|
|
|
98
98
|
### Collections
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cplieger/reactive",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"exports": {
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"@eslint/js": "10.0.1",
|
|
16
16
|
"@vitest/coverage-v8": "4.1.9",
|
|
17
|
-
"eslint": "10.
|
|
17
|
+
"eslint": "10.6.0",
|
|
18
18
|
"fast-check": "4.8.0",
|
|
19
19
|
"happy-dom": "20.10.6",
|
|
20
|
-
"prettier": "3.
|
|
20
|
+
"prettier": "3.9.0",
|
|
21
21
|
"typescript": "6.0.3",
|
|
22
22
|
"typescript-eslint": "8.62.0",
|
|
23
23
|
"vitest": "4.1.9"
|
package/src/el.ts
CHANGED
|
@@ -8,12 +8,7 @@ import { trackHandler } from "./reconcile-tree.js";
|
|
|
8
8
|
/** A value for an element attribute/property/handler. Functions are treated as
|
|
9
9
|
* event handlers when the key starts with `on`. */
|
|
10
10
|
export type AttrValue =
|
|
11
|
-
|
|
|
12
|
-
| number
|
|
13
|
-
| boolean
|
|
14
|
-
| null
|
|
15
|
-
| undefined
|
|
16
|
-
| ((...args: never[]) => unknown);
|
|
11
|
+
string | number | boolean | null | undefined | ((...args: never[]) => unknown);
|
|
17
12
|
|
|
18
13
|
// Keys set as DOM *properties* (not attributes) because the attribute form
|
|
19
14
|
// either doesn't reflect (value/checked) or is awkward (boolean presence).
|