reactronic 0.24.120 → 0.24.122
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.
|
@@ -17,6 +17,7 @@ export { Transaction } from './core/Transaction.js';
|
|
|
17
17
|
export { Monitor } from './core/Monitor.js';
|
|
18
18
|
export { Journal } from './core/Journal.js';
|
|
19
19
|
export { RxSystem, raw, obs, transactional, reactive, cached, transaction, unobs, sensitive, options } from './RxSystem.js';
|
|
20
|
+
export { Reaction } from './Reaction.js';
|
|
20
21
|
export { RxNode, Mode, Priority, BaseDriver, RxNodeVariable } from './core/RxNode.js';
|
|
21
22
|
export type { Delegate, SimpleDelegate, RxNodeDecl, RxNodeDriver, RxNodeContext } from './core/RxNode.js';
|
|
22
23
|
export { Clock } from './Clock.js';
|
package/build/dist/source/api.js
CHANGED
|
@@ -13,5 +13,6 @@ export { Transaction } from './core/Transaction.js';
|
|
|
13
13
|
export { Monitor } from './core/Monitor.js';
|
|
14
14
|
export { Journal } from './core/Journal.js';
|
|
15
15
|
export { RxSystem, raw, obs, transactional, reactive, cached, transaction, unobs, sensitive, options } from './RxSystem.js';
|
|
16
|
+
export { Reaction } from './Reaction.js';
|
|
16
17
|
export { RxNode, Mode, Priority, BaseDriver, RxNodeVariable } from './core/RxNode.js';
|
|
17
18
|
export { Clock } from './Clock.js';
|
|
@@ -46,6 +46,7 @@ export declare abstract class RxNode<E = unknown> {
|
|
|
46
46
|
static set childrenShuffling(value: boolean);
|
|
47
47
|
static triggerUpdate(node: RxNode<any>, triggers: unknown): void;
|
|
48
48
|
static updateNestedNodesThenDo(action: (error: unknown) => void): void;
|
|
49
|
+
static markAsMounted(node: RxNode<any>, yes: boolean): void;
|
|
49
50
|
static findMatchingHost<E = unknown, R = unknown>(node: RxNode<E>, match: SimpleDelegate<RxNode<E>, boolean>): RxNode<R> | undefined;
|
|
50
51
|
static findMatchingPrevSibling<E = unknown, R = unknown>(node: RxNode<E>, match: SimpleDelegate<RxNode<E>, boolean>): RxNode<R> | undefined;
|
|
51
52
|
static forEachChildRecursively<E = unknown>(node: RxNode<E>, action: SimpleDelegate<RxNode<E>>): void;
|
|
@@ -109,6 +109,14 @@ export class RxNode {
|
|
|
109
109
|
static updateNestedNodesThenDo(action) {
|
|
110
110
|
runUpdateNestedNodesThenDo(undefined, action);
|
|
111
111
|
}
|
|
112
|
+
static markAsMounted(node, yes) {
|
|
113
|
+
const n = node;
|
|
114
|
+
if (n.stamp < 0)
|
|
115
|
+
throw new Error('finalized node cannot be mounted or unmounted');
|
|
116
|
+
if (n.stamp >= Number.MAX_SAFE_INTEGER)
|
|
117
|
+
throw new Error('node must be initialized before mounting');
|
|
118
|
+
n.stamp = yes ? 0 : Number.MAX_SAFE_INTEGER - 1;
|
|
119
|
+
}
|
|
112
120
|
static findMatchingHost(node, match) {
|
|
113
121
|
let p = node.host;
|
|
114
122
|
while (p !== p.host && !match(p))
|
|
@@ -451,8 +459,8 @@ function triggerUpdateViaSeat(seat) {
|
|
|
451
459
|
function mountOrRemountIfNecessary(node) {
|
|
452
460
|
const driver = node.driver;
|
|
453
461
|
if (node.stamp === Number.MAX_SAFE_INTEGER) {
|
|
454
|
-
node.stamp = Number.MAX_SAFE_INTEGER - 1;
|
|
455
462
|
unobs(() => {
|
|
463
|
+
node.stamp = Number.MAX_SAFE_INTEGER - 1;
|
|
456
464
|
driver.initialize(node);
|
|
457
465
|
if (!node.has(Mode.ManualMount)) {
|
|
458
466
|
node.stamp = 0;
|