doxum 0.1.33 → 0.1.34
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 +6 -7
- package/dist/advanced.cjs +1 -1
- package/dist/advanced.js +1 -1
- package/dist/index.cjs +340 -124
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -6
- package/dist/index.d.ts +2 -6
- package/dist/index.js +340 -124
- package/dist/index.js.map +1 -1
- package/dist/{transform-CSPGdBe5.cjs → transform-Bt1Mwgrj.cjs} +140 -157
- package/dist/transform-Bt1Mwgrj.cjs.map +1 -0
- package/dist/{transform-A9Lx5R2l.js → transform-RghG_Qxs.js} +141 -152
- package/dist/transform-RghG_Qxs.js.map +1 -0
- package/package.json +1 -1
- package/skills/doxum-runtime/SKILL.md +1 -1
- package/skills/doxum-runtime/references/integrations.md +2 -2
- package/skills/doxum-runtime/references/invariants.md +6 -3
- package/skills/doxum-runtime/references/projections.md +21 -20
- package/skills/doxum-runtime/references/public-api.md +3 -7
- package/skills/doxum-runtime/references/recipes.md +2 -2
- package/dist/transform-A9Lx5R2l.js.map +0 -1
- package/dist/transform-CSPGdBe5.cjs.map +0 -1
package/README.md
CHANGED
|
@@ -282,26 +282,25 @@ exposes `read`, `select`, `items`, `update`, `batch`, `scope` and `dispose`.
|
|
|
282
282
|
|
|
283
283
|
### Commands inside a batch
|
|
284
284
|
|
|
285
|
-
|
|
285
|
+
`runtime.read` and `Readable.current()` read current state, including inside a batch. Derived reads evaluate necessary stale dependencies on demand; batch defers external notifications.
|
|
286
286
|
|
|
287
287
|
```ts
|
|
288
288
|
const count = input(0);
|
|
289
289
|
const doubled = derive({ count }, ({ count }) => count * 2);
|
|
290
290
|
|
|
291
291
|
function increment() {
|
|
292
|
-
runtime.
|
|
293
|
-
runtime.update(count, read(count) + 1);
|
|
294
|
-
});
|
|
292
|
+
runtime.update(count, runtime.read(count) + 1);
|
|
295
293
|
}
|
|
296
294
|
|
|
297
295
|
runtime.batch(() => {
|
|
298
296
|
increment();
|
|
297
|
+
runtime.read(doubled); // 2
|
|
299
298
|
increment();
|
|
299
|
+
runtime.read(doubled); // 4
|
|
300
300
|
});
|
|
301
|
-
runtime.read(doubled); // 4
|
|
302
301
|
```
|
|
303
302
|
|
|
304
|
-
|
|
303
|
+
Nested batches notify at the outer boundary. Cross-input commands use the same reads without mirrors or borrowed reader parameters. Input equality is checked before acceptance; a failed edit leaves earlier successes intact. A batch is not a transaction, and intermediate reads may advance retained processors more than once. See [current reads and batching](docs/projections.md#current-reads-and-batching) for snapshots, net notifications and lifecycle.
|
|
305
304
|
|
|
306
305
|
### Keyed projection
|
|
307
306
|
|
|
@@ -454,7 +453,7 @@ Its state is owned by the `ProjectionRuntime`, not the document, history or pers
|
|
|
454
453
|
Updates are synchronous and atomic. It publishes exact keyed `CollectionChange`
|
|
455
454
|
transitions and preserves order. The optional per-entry equality defaults to `Object.is`
|
|
456
455
|
and suppresses equivalent `set` operations. Callback and equality failures leave both
|
|
457
|
-
the
|
|
456
|
+
the current value and the next draft unchanged.
|
|
458
457
|
|
|
459
458
|
The processor-facing `CollectionChange` type and `collectionChange.keys(...)` utility
|
|
460
459
|
are exported by `doxum/advanced`. The utility lazily iterates incremental added,
|
package/dist/advanced.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_transform = require("./transform-
|
|
2
|
+
const require_transform = require("./transform-Bt1Mwgrj.cjs");
|
|
3
3
|
const require_record = require("./record-ChYUi8PP.cjs");
|
|
4
4
|
//#region core/src/projection/advanced.ts
|
|
5
5
|
const resetCollectionChange = Object.freeze({ kind: "reset" });
|
package/dist/advanced.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as defineProcessor, S as compileProjectionDependencies, _ as assertSynchronous, r as collectionChange, t as createKeyedTransform, w as collectionView } from "./transform-RghG_Qxs.js";
|
|
2
2
|
import { n as isPlainObject } from "./record-B2yRhYsc.js";
|
|
3
3
|
//#region core/src/projection/advanced.ts
|
|
4
4
|
const resetCollectionChange = Object.freeze({ kind: "reset" });
|