reactronic 0.24.316 → 0.24.401

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.
@@ -6,7 +6,7 @@ export type ScriptAsync<E> = (el: E, basis: () => Promise<void>) => Promise<void
6
6
  export type Handler<E = unknown, R = void> = (el: E) => R;
7
7
  export declare enum Mode {
8
8
  default = 0,
9
- independentUpdate = 1,
9
+ autonomous = 1,
10
10
  manualMount = 2
11
11
  }
12
12
  export declare enum Priority {
@@ -23,7 +23,7 @@ export declare abstract class ReactiveNode<E = unknown> {
23
23
  abstract element: E;
24
24
  abstract readonly host: ReactiveNode;
25
25
  abstract readonly children: MergeListReader<ReactiveNode>;
26
- abstract readonly seat: MergedItem<ReactiveNode<E>> | undefined;
26
+ abstract readonly slot: MergedItem<ReactiveNode<E>> | undefined;
27
27
  abstract readonly stamp: number;
28
28
  abstract readonly outer: ReactiveNode;
29
29
  abstract readonly context: ReactiveNodeContext | undefined;
@@ -36,9 +36,9 @@ export declare abstract class ReactiveNode<E = unknown> {
36
36
  static readonly longFrameDuration = 300;
37
37
  static currentUpdatePriority: Priority;
38
38
  static frameDuration: number;
39
- static declare<E = void>(driver: ReactiveNodeDriver<E>, script?: Script<E>, scriptAsync?: ScriptAsync<E>, key?: string, mode?: Mode, creation?: Script<E>, creationAsync?: ScriptAsync<E>, destruction?: Script<E>, triggers?: unknown, basis?: ReactiveNodeDecl<E>): ReactiveNode<E>;
39
+ static declare<E = void>(driver: ReactiveNodeDriver<E>, content?: Script<E>, contentAsync?: ScriptAsync<E>, key?: string, mode?: Mode, creation?: Script<E>, creationAsync?: ScriptAsync<E>, destruction?: Script<E>, triggers?: unknown, basis?: ReactiveNodeDecl<E>): ReactiveNode<E>;
40
40
  static declare<E = void>(driver: ReactiveNodeDriver<E>, declaration?: ReactiveNodeDecl<E>): ReactiveNode<E>;
41
- static declare<E = void>(driver: ReactiveNodeDriver<E>, scriptOrDeclaration?: Script<E> | ReactiveNodeDecl<E>, scriptAsync?: ScriptAsync<E>, key?: string, mode?: Mode, creation?: Script<E>, creationAsync?: ScriptAsync<E>, destruction?: Script<E>, triggers?: unknown, basis?: ReactiveNodeDecl<E>): ReactiveNode<E>;
41
+ static declare<E = void>(driver: ReactiveNodeDriver<E>, contentOrDeclaration?: Script<E> | ReactiveNodeDecl<E>, contentAsync?: ScriptAsync<E>, key?: string, mode?: Mode, creation?: Script<E>, creationAsync?: ScriptAsync<E>, destruction?: Script<E>, triggers?: unknown, basis?: ReactiveNodeDecl<E>): ReactiveNode<E>;
42
42
  static withBasis<E = void>(declaration?: ReactiveNodeDecl<E>, basis?: ReactiveNodeDecl<E>): ReactiveNodeDecl<E>;
43
43
  static get isFirstUpdate(): boolean;
44
44
  static get key(): string;
@@ -59,8 +59,8 @@ export declare abstract class ReactiveNode<E = unknown> {
59
59
  static setDefaultLoggingOptions(logging?: LoggingOptions): void;
60
60
  }
61
61
  export type ReactiveNodeDecl<E = unknown> = {
62
- script?: Script<E>;
63
- scriptAsync?: ScriptAsync<E>;
62
+ content?: Script<E>;
63
+ contentAsync?: ScriptAsync<E>;
64
64
  key?: string;
65
65
  mode?: Mode;
66
66
  creation?: Script<E>;
@@ -26,7 +26,7 @@ import { ReactiveSystem, options, raw, reactive, unobs } from "../ReactiveSystem
26
26
  export var Mode;
27
27
  (function (Mode) {
28
28
  Mode[Mode["default"] = 0] = "default";
29
- Mode[Mode["independentUpdate"] = 1] = "independentUpdate";
29
+ Mode[Mode["autonomous"] = 1] = "autonomous";
30
30
  Mode[Mode["manualMount"] = 2] = "manualMount";
31
31
  })(Mode || (Mode = {}));
32
32
  export var Priority;
@@ -36,23 +36,23 @@ export var Priority;
36
36
  Priority[Priority["background"] = 2] = "background";
37
37
  })(Priority || (Priority = {}));
38
38
  export class ReactiveNode {
39
- static declare(driver, scriptOrDeclaration, scriptAsync, key, mode, creation, creationAsync, destruction, triggers, basis) {
39
+ static declare(driver, contentOrDeclaration, contentAsync, key, mode, creation, creationAsync, destruction, triggers, basis) {
40
40
  let result;
41
41
  let declaration;
42
- if (scriptOrDeclaration instanceof Function) {
42
+ if (contentOrDeclaration instanceof Function) {
43
43
  declaration = {
44
- script: scriptOrDeclaration, scriptAsync, key, mode,
44
+ content: contentOrDeclaration, contentAsync, key, mode,
45
45
  creation, creationAsync, destruction, triggers, basis,
46
46
  };
47
47
  }
48
48
  else
49
- declaration = scriptOrDeclaration !== null && scriptOrDeclaration !== void 0 ? scriptOrDeclaration : {};
49
+ declaration = contentOrDeclaration !== null && contentOrDeclaration !== void 0 ? contentOrDeclaration : {};
50
50
  let effectiveKey = declaration.key;
51
- const owner = gOwnSeat === null || gOwnSeat === void 0 ? void 0 : gOwnSeat.instance;
51
+ const owner = gOwnSlot === null || gOwnSlot === void 0 ? void 0 : gOwnSlot.instance;
52
52
  if (owner) {
53
53
  let existing = owner.driver.child(owner, driver, declaration, declaration.basis);
54
54
  const children = owner.children;
55
- existing !== null && existing !== void 0 ? existing : (existing = children.tryMergeAsExisting(effectiveKey = effectiveKey || generateKey(owner), undefined, "nested elements can be declared inside update function only"));
55
+ existing !== null && existing !== void 0 ? existing : (existing = children.tryMergeAsExisting(effectiveKey = effectiveKey || generateKey(owner), undefined, "nested elements can be declared inside content script only"));
56
56
  if (existing) {
57
57
  result = existing.instance;
58
58
  if (result.driver !== driver && driver !== undefined)
@@ -64,13 +64,13 @@ export class ReactiveNode {
64
64
  }
65
65
  else {
66
66
  result = new ReactiveNodeImpl(effectiveKey || generateKey(owner), driver, declaration, owner);
67
- result.seat = children.mergeAsAdded(result);
67
+ result.slot = children.mergeAsAdded(result);
68
68
  }
69
69
  }
70
70
  else {
71
71
  result = new ReactiveNodeImpl(effectiveKey || "", driver, declaration, owner);
72
- result.seat = MergeList.createItem(result);
73
- triggerUpdateViaSeat(result.seat);
72
+ result.slot = MergeList.createItem(result);
73
+ triggerUpdateViaSlot(result.slot);
74
74
  }
75
75
  return result;
76
76
  }
@@ -82,43 +82,43 @@ export class ReactiveNode {
82
82
  return declaration;
83
83
  }
84
84
  static get isFirstUpdate() {
85
- return ReactiveNodeImpl.ownSeat.instance.stamp === 1;
85
+ return ReactiveNodeImpl.ownSlot.instance.stamp === 1;
86
86
  }
87
87
  static get key() {
88
- return ReactiveNodeImpl.ownSeat.instance.key;
88
+ return ReactiveNodeImpl.ownSlot.instance.key;
89
89
  }
90
90
  static get stamp() {
91
- return ReactiveNodeImpl.ownSeat.instance.stamp;
91
+ return ReactiveNodeImpl.ownSlot.instance.stamp;
92
92
  }
93
93
  static get triggers() {
94
- return ReactiveNodeImpl.ownSeat.instance.declaration.triggers;
94
+ return ReactiveNodeImpl.ownSlot.instance.declaration.triggers;
95
95
  }
96
96
  static get priority() {
97
- return ReactiveNodeImpl.ownSeat.instance.priority;
97
+ return ReactiveNodeImpl.ownSlot.instance.priority;
98
98
  }
99
99
  static set priority(value) {
100
- ReactiveNodeImpl.ownSeat.instance.priority = value;
100
+ ReactiveNodeImpl.ownSlot.instance.priority = value;
101
101
  }
102
102
  static get childrenShuffling() {
103
- return ReactiveNodeImpl.ownSeat.instance.childrenShuffling;
103
+ return ReactiveNodeImpl.ownSlot.instance.childrenShuffling;
104
104
  }
105
105
  static set childrenShuffling(value) {
106
- ReactiveNodeImpl.ownSeat.instance.childrenShuffling = value;
106
+ ReactiveNodeImpl.ownSlot.instance.childrenShuffling = value;
107
107
  }
108
108
  static triggerUpdate(node, triggers) {
109
109
  const impl = node;
110
110
  const declaration = impl.declaration;
111
111
  if (!triggersAreEqual(triggers, declaration.triggers)) {
112
112
  declaration.triggers = triggers;
113
- triggerUpdateViaSeat(impl.seat);
113
+ triggerUpdateViaSlot(impl.slot);
114
114
  }
115
115
  }
116
116
  static triggerDeactivation(node) {
117
117
  const impl = node;
118
- triggerDeactivation(impl.seat, true, true);
118
+ triggerDeactivation(impl.slot, true, true);
119
119
  }
120
120
  static updateNestedNodesThenDo(action) {
121
- runUpdateNestedNodesThenDo(ReactiveNodeImpl.ownSeat, undefined, action);
121
+ runUpdateNestedNodesThenDo(ReactiveNodeImpl.ownSlot, undefined, action);
122
122
  }
123
123
  static markAsMounted(node, yes) {
124
124
  const n = node;
@@ -135,7 +135,7 @@ export class ReactiveNode {
135
135
  return p;
136
136
  }
137
137
  static findMatchingPrevSibling(node, match) {
138
- let p = node.seat.prev;
138
+ let p = node.slot.prev;
139
139
  while (p && !match(p.instance))
140
140
  p = p.prev;
141
141
  return p === null || p === void 0 ? void 0 : p.instance;
@@ -174,7 +174,7 @@ export class BaseDriver {
174
174
  mount(node) {
175
175
  }
176
176
  update(node) {
177
- return invokeScriptUsingBasisChain(node.element, node.declaration);
177
+ return invokeContentUsingBasisChain(node.element, node.declaration);
178
178
  }
179
179
  child(ownerNode, childDriver, childDeclaration, childBasis) {
180
180
  return undefined;
@@ -211,22 +211,19 @@ function getModeUsingBasisChain(declaration) {
211
211
  var _a;
212
212
  return (_a = declaration === null || declaration === void 0 ? void 0 : declaration.mode) !== null && _a !== void 0 ? _a : ((declaration === null || declaration === void 0 ? void 0 : declaration.basis) ? getModeUsingBasisChain(declaration === null || declaration === void 0 ? void 0 : declaration.basis) : Mode.default);
213
213
  }
214
- function invokeScriptUsingBasisChain(element, declaration) {
214
+ function invokeContentUsingBasisChain(element, declaration) {
215
215
  let result = undefined;
216
216
  const basis = declaration.basis;
217
- const script = declaration.script;
218
- const scriptAsync = declaration.scriptAsync;
219
- if (script && scriptAsync) {
220
- throw misuse("'script' and 'scriptAsync' cannot be defined together");
221
- }
222
- if (script) {
223
- result = script(element, basis ? () => invokeScriptUsingBasisChain(element, basis) : NOP);
224
- }
225
- else if (scriptAsync) {
226
- result = scriptAsync(element, basis ? () => invokeScriptUsingBasisChain(element, basis) : NOP_ASYNC);
227
- }
217
+ const content = declaration.content;
218
+ const contentAsync = declaration.contentAsync;
219
+ if (content && contentAsync)
220
+ throw misuse("'content' and 'contentAsync' cannot be defined together");
221
+ if (content)
222
+ result = content(element, basis ? () => invokeContentUsingBasisChain(element, basis) : NOP);
223
+ else if (contentAsync)
224
+ result = contentAsync(element, basis ? () => invokeContentUsingBasisChain(element, basis) : NOP_ASYNC);
228
225
  else if (basis)
229
- result = invokeScriptUsingBasisChain(element, basis);
226
+ result = invokeContentUsingBasisChain(element, basis);
230
227
  return result;
231
228
  }
232
229
  function invokeCreationUsingBasisChain(element, declaration) {
@@ -234,15 +231,12 @@ function invokeCreationUsingBasisChain(element, declaration) {
234
231
  const basis = declaration.basis;
235
232
  const creation = declaration.creation;
236
233
  const creationAsync = declaration.creationAsync;
237
- if (creation && creationAsync) {
234
+ if (creation && creationAsync)
238
235
  throw misuse("'creation' and 'creationAsync' cannot be defined together");
239
- }
240
- if (creation) {
236
+ if (creation)
241
237
  result = creation(element, basis ? () => invokeCreationUsingBasisChain(element, basis) : NOP);
242
- }
243
- else if (creationAsync) {
238
+ else if (creationAsync)
244
239
  result = creationAsync(element, basis ? () => invokeCreationUsingBasisChain(element, basis) : NOP_ASYNC);
245
- }
246
240
  else if (basis)
247
241
  result = invokeCreationUsingBasisChain(element, basis);
248
242
  return result;
@@ -292,40 +286,40 @@ class ReactiveNodeImpl extends ReactiveNode {
292
286
  this.element = driver.allocate(this);
293
287
  this.host = thisAsUnknown;
294
288
  this.children = new MergeList(getNodeKey, true);
295
- this.seat = undefined;
289
+ this.slot = undefined;
296
290
  this.stamp = Number.MAX_SAFE_INTEGER;
297
291
  this.context = undefined;
298
292
  this.numerator = 0;
299
293
  this.priority = Priority.realtime;
300
294
  this.childrenShuffling = false;
301
295
  ReactiveNodeImpl.grandNodeCount++;
302
- if (this.has(Mode.independentUpdate))
296
+ if (this.has(Mode.autonomous))
303
297
  ReactiveNodeImpl.disposableNodeCount++;
304
298
  }
305
299
  get strictOrder() { return this.children.isStrict; }
306
300
  set strictOrder(value) { this.children.isStrict = value; }
307
- get isMoved() { return this.owner.children.isMoved(this.seat); }
301
+ get isMoved() { return this.owner.children.isMoved(this.slot); }
308
302
  has(mode) {
309
303
  return (getModeUsingBasisChain(this.declaration) & mode) === mode;
310
304
  }
311
305
  update(_triggers) {
312
- updateNow(this.seat);
306
+ updateNow(this.slot);
313
307
  }
314
308
  configureReactronic(options) {
315
- if (this.stamp < Number.MAX_SAFE_INTEGER - 1 || !this.has(Mode.independentUpdate))
316
- throw new Error("reactronic can be configured only for elements with independent update mode and only during activation");
309
+ if (this.stamp < Number.MAX_SAFE_INTEGER - 1 || !this.has(Mode.autonomous))
310
+ throw new Error("reactronic can be configured only for elements with autonomous mode and only during activation");
317
311
  return ReactiveSystem.getOperation(this.update).configure(options);
318
312
  }
319
- static get ownSeat() {
320
- if (!gOwnSeat)
313
+ static get ownSlot() {
314
+ if (!gOwnSlot)
321
315
  throw new Error("current element is undefined");
322
- return gOwnSeat;
316
+ return gOwnSlot;
323
317
  }
324
318
  static tryUseNodeVariableValue(variable) {
325
319
  var _a, _b;
326
- let node = ReactiveNodeImpl.ownSeat.instance;
320
+ let node = ReactiveNodeImpl.ownSlot.instance;
327
321
  while (((_a = node.context) === null || _a === void 0 ? void 0 : _a.variable) !== variable && node.owner !== node)
328
- node = node.outer.seat.instance;
322
+ node = node.outer.slot.instance;
329
323
  return (_b = node.context) === null || _b === void 0 ? void 0 : _b.value;
330
324
  }
331
325
  static useNodeVariableValue(variable) {
@@ -336,7 +330,7 @@ class ReactiveNodeImpl extends ReactiveNode {
336
330
  return result;
337
331
  }
338
332
  static setNodeVariableValue(variable, value) {
339
- const node = ReactiveNodeImpl.ownSeat.instance;
333
+ const node = ReactiveNodeImpl.ownSlot.instance;
340
334
  const owner = node.owner;
341
335
  const hostCtx = unobs(() => { var _a; return (_a = owner.context) === null || _a === void 0 ? void 0 : _a.value; });
342
336
  if (value && value !== hostCtx) {
@@ -378,10 +372,10 @@ __decorate([
378
372
  function getNodeKey(node) {
379
373
  return node.stamp >= 0 ? node.key : undefined;
380
374
  }
381
- function runUpdateNestedNodesThenDo(ownSeat, error, action) {
382
- runInside(ownSeat, () => {
375
+ function runUpdateNestedNodesThenDo(ownSlot, error, action) {
376
+ runInside(ownSlot, () => {
383
377
  var _a;
384
- const owner = ownSeat.instance;
378
+ const owner = ownSlot.instance;
385
379
  const children = owner.children;
386
380
  if (children.isMergeInProgress) {
387
381
  let promised = undefined;
@@ -404,7 +398,7 @@ function runUpdateNestedNodesThenDo(ownSeat, error, action) {
404
398
  mounting = markToMountIfNecessary(mounting, host, child, children, sequential);
405
399
  const p = (_a = childNode.priority) !== null && _a !== void 0 ? _a : Priority.realtime;
406
400
  if (p === Priority.realtime)
407
- triggerUpdateViaSeat(child);
401
+ triggerUpdateViaSlot(child);
408
402
  else if (p === Priority.normal)
409
403
  p1 = push(child, p1);
410
404
  else
@@ -413,7 +407,7 @@ function runUpdateNestedNodesThenDo(ownSeat, error, action) {
413
407
  partition = childNode;
414
408
  }
415
409
  if (!Transaction.isCanceled && (p1 !== undefined || p2 !== undefined))
416
- promised = startIncrementalUpdate(ownSeat, children, p1, p2).then(() => action(error), e => action(e));
410
+ promised = startIncrementalUpdate(ownSlot, children, p1, p2).then(() => action(error), e => action(e));
417
411
  }
418
412
  }
419
413
  finally {
@@ -423,26 +417,26 @@ function runUpdateNestedNodesThenDo(ownSeat, error, action) {
423
417
  }
424
418
  });
425
419
  }
426
- function markToMountIfNecessary(mounting, host, seat, children, sequential) {
427
- const node = seat.instance;
420
+ function markToMountIfNecessary(mounting, host, slot, children, sequential) {
421
+ const node = slot.instance;
428
422
  if (node.element.native && !node.has(Mode.manualMount)) {
429
423
  if (mounting || node.host !== host) {
430
- children.markAsMoved(seat);
424
+ children.markAsMoved(slot);
431
425
  mounting = false;
432
426
  }
433
427
  }
434
- else if (sequential && children.isMoved(seat))
428
+ else if (sequential && children.isMoved(slot))
435
429
  mounting = true;
436
430
  node.host = host;
437
431
  return mounting;
438
432
  }
439
- function startIncrementalUpdate(ownerSeat, allChildren, priority1, priority2) {
433
+ function startIncrementalUpdate(ownerSlot, allChildren, priority1, priority2) {
440
434
  return __awaiter(this, void 0, void 0, function* () {
441
- const stamp = ownerSeat.instance.stamp;
435
+ const stamp = ownerSlot.instance.stamp;
442
436
  if (priority1)
443
- yield updateIncrementally(ownerSeat, stamp, allChildren, priority1, Priority.normal);
437
+ yield updateIncrementally(ownerSlot, stamp, allChildren, priority1, Priority.normal);
444
438
  if (priority2)
445
- yield updateIncrementally(ownerSeat, stamp, allChildren, priority2, Priority.background);
439
+ yield updateIncrementally(ownerSlot, stamp, allChildren, priority2, Priority.background);
446
440
  });
447
441
  }
448
442
  function updateIncrementally(owner, stamp, allChildren, items, priority) {
@@ -458,7 +452,7 @@ function updateIncrementally(owner, stamp, allChildren, items, priority) {
458
452
  const frameDurationLimit = priority === Priority.background ? ReactiveNode.shortFrameDuration : Infinity;
459
453
  let frameDuration = Math.min(frameDurationLimit, Math.max(ReactiveNode.frameDuration / 4, ReactiveNode.shortFrameDuration));
460
454
  for (const child of items) {
461
- triggerUpdateViaSeat(child);
455
+ triggerUpdateViaSlot(child);
462
456
  if (Transaction.isFrameOver(1, frameDuration)) {
463
457
  ReactiveNode.currentUpdatePriority = outerPriority;
464
458
  yield Transaction.requestNextFrame(0);
@@ -476,10 +470,10 @@ function updateIncrementally(owner, stamp, allChildren, items, priority) {
476
470
  }
477
471
  });
478
472
  }
479
- function triggerUpdateViaSeat(seat) {
480
- const node = seat.instance;
473
+ function triggerUpdateViaSlot(slot) {
474
+ const node = slot.instance;
481
475
  if (node.stamp >= 0) {
482
- if (node.has(Mode.independentUpdate)) {
476
+ if (node.has(Mode.autonomous)) {
483
477
  if (node.stamp === Number.MAX_SAFE_INTEGER) {
484
478
  Transaction.outside(() => {
485
479
  if (ReactiveSystem.isLogging)
@@ -492,7 +486,7 @@ function triggerUpdateViaSeat(seat) {
492
486
  unobs(node.update, node.declaration.triggers);
493
487
  }
494
488
  else
495
- updateNow(seat);
489
+ updateNow(slot);
496
490
  }
497
491
  }
498
492
  function mountOrRemountIfNecessary(node) {
@@ -511,11 +505,11 @@ function mountOrRemountIfNecessary(node) {
511
505
  else if (node.isMoved && !node.has(Mode.manualMount) && node.host !== node)
512
506
  unobs(() => driver.mount(node));
513
507
  }
514
- function updateNow(seat) {
515
- const node = seat.instance;
508
+ function updateNow(slot) {
509
+ const node = slot.instance;
516
510
  if (node.stamp >= 0) {
517
511
  let result = undefined;
518
- runInside(seat, () => {
512
+ runInside(slot, () => {
519
513
  mountOrRemountIfNecessary(node);
520
514
  if (node.stamp < Number.MAX_SAFE_INTEGER - 1) {
521
515
  try {
@@ -524,10 +518,10 @@ function updateNow(seat) {
524
518
  node.children.beginMerge();
525
519
  const driver = node.driver;
526
520
  result = driver.update(node);
527
- result = proceedSyncOrAsync(result, v => { runUpdateNestedNodesThenDo(seat, undefined, NOP); return v; }, e => { console.log(e); runUpdateNestedNodesThenDo(seat, e !== null && e !== void 0 ? e : new Error("unknown error"), NOP); });
521
+ result = proceedSyncOrAsync(result, v => { runUpdateNestedNodesThenDo(slot, undefined, NOP); return v; }, e => { console.log(e); runUpdateNestedNodesThenDo(slot, e !== null && e !== void 0 ? e : new Error("unknown error"), NOP); });
528
522
  }
529
523
  catch (e) {
530
- runUpdateNestedNodesThenDo(seat, e, NOP);
524
+ runUpdateNestedNodesThenDo(slot, e, NOP);
531
525
  console.log(`Update failed: ${node.key}`);
532
526
  console.log(`${e}`);
533
527
  }
@@ -535,23 +529,23 @@ function updateNow(seat) {
535
529
  });
536
530
  }
537
531
  }
538
- function triggerDeactivation(seat, isLeader, individual) {
539
- const node = seat.instance;
532
+ function triggerDeactivation(slot, isLeader, individual) {
533
+ const node = slot.instance;
540
534
  if (node.stamp >= 0) {
541
535
  const driver = node.driver;
542
536
  if (individual && node.key !== node.declaration.key && !driver.isPartition)
543
537
  console.log(`WARNING: it is recommended to assign explicit key for conditional element in order to avoid unexpected side effects: ${node.key}`);
544
538
  node.stamp = ~node.stamp;
545
539
  const childrenAreLeaders = unobs(() => driver.destroy(node, isLeader));
546
- if (node.has(Mode.independentUpdate)) {
547
- seat.aux = undefined;
540
+ if (node.has(Mode.autonomous)) {
541
+ slot.aux = undefined;
548
542
  const last = gLastToDispose;
549
543
  if (last)
550
- gLastToDispose = last.aux = seat;
544
+ gLastToDispose = last.aux = slot;
551
545
  else
552
- gFirstToDispose = gLastToDispose = seat;
553
- if (gFirstToDispose === seat)
554
- Transaction.run({ isolation: Isolation.disjoinForInternalDisposal, hint: `runDisposalLoop(initiator=${seat.instance.key})` }, () => {
546
+ gFirstToDispose = gLastToDispose = slot;
547
+ if (gFirstToDispose === slot)
548
+ Transaction.run({ isolation: Isolation.disjoinForInternalDisposal, hint: `runDisposalLoop(initiator=${slot.instance.key})` }, () => {
555
549
  void runDisposalLoop().then(NOP, error => console.log(error));
556
550
  });
557
551
  }
@@ -563,12 +557,12 @@ function triggerDeactivation(seat, isLeader, individual) {
563
557
  function runDisposalLoop() {
564
558
  return __awaiter(this, void 0, void 0, function* () {
565
559
  yield Transaction.requestNextFrame();
566
- let seat = gFirstToDispose;
567
- while (seat !== undefined) {
560
+ let slot = gFirstToDispose;
561
+ while (slot !== undefined) {
568
562
  if (Transaction.isFrameOver(500, 5))
569
563
  yield Transaction.requestNextFrame();
570
- ReactiveSystem.dispose(seat.instance);
571
- seat = seat.aux;
564
+ ReactiveSystem.dispose(slot.instance);
565
+ slot = slot.aux;
572
566
  ReactiveNodeImpl.disposableNodeCount--;
573
567
  }
574
568
  gFirstToDispose = gLastToDispose = undefined;
@@ -576,7 +570,7 @@ function runDisposalLoop() {
576
570
  }
577
571
  function wrapToRunInside(func) {
578
572
  let wrappedToRunInside;
579
- const outer = gOwnSeat;
573
+ const outer = gOwnSlot;
580
574
  if (outer)
581
575
  wrappedToRunInside = (...args) => {
582
576
  return runInside(outer, func, ...args);
@@ -585,14 +579,14 @@ function wrapToRunInside(func) {
585
579
  wrappedToRunInside = func;
586
580
  return wrappedToRunInside;
587
581
  }
588
- function runInside(seat, func, ...args) {
589
- const outer = gOwnSeat;
582
+ function runInside(slot, func, ...args) {
583
+ const outer = gOwnSlot;
590
584
  try {
591
- gOwnSeat = seat;
585
+ gOwnSlot = slot;
592
586
  return func(...args);
593
587
  }
594
588
  finally {
595
- gOwnSeat = outer;
589
+ gOwnSlot = outer;
596
590
  }
597
591
  }
598
592
  function triggersAreEqual(a1, a2) {
@@ -646,6 +640,6 @@ function defaultReject(error) {
646
640
  Promise.prototype.then = reactronicDomHookedThen;
647
641
  const NOP = (...args) => { };
648
642
  const NOP_ASYNC = (...args) => __awaiter(void 0, void 0, void 0, function* () { });
649
- let gOwnSeat = undefined;
643
+ let gOwnSlot = undefined;
650
644
  let gFirstToDispose = undefined;
651
645
  let gLastToDispose = undefined;
@@ -101,7 +101,7 @@ export function getCallerInfo(prefix) {
101
101
  return result;
102
102
  }
103
103
  function extractFunctionAndLocation(s) {
104
- const match = s.match(/(?:\s*at\s+)?(?:(\S+)\s\()?(?:.*?)([^\/\(\):]+)(?:(:|\d)*\)?)$/);
104
+ const match = s.match(/(?:\s*at\s+)?(?:(\S+)\s\()?(?:.*?)([^\/\(\)]+)(?:(:|\d)*\)?)$/);
105
105
  return {
106
106
  func: (match === null || match === void 0 ? void 0 : match[1]) || "",
107
107
  file: (match === null || match === void 0 ? void 0 : match[2]) || "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reactronic",
3
- "version": "0.24.316",
3
+ "version": "0.24.401",
4
4
  "description": "Reactronic - Transactional Reactive State Management",
5
5
  "publisher": "Nezaboodka Software",
6
6
  "license": "Apache-2.0",