reactronic 0.94.25036 → 0.95.25040

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.
Files changed (42) hide show
  1. package/README.md +67 -66
  2. package/build/dist/source/Enums.d.ts +3 -3
  3. package/build/dist/source/Enums.js +3 -3
  4. package/build/dist/source/OperationEx.d.ts +2 -2
  5. package/build/dist/source/OperationEx.js +5 -5
  6. package/build/dist/source/Options.d.ts +2 -2
  7. package/build/dist/source/Pipe.d.ts +2 -2
  8. package/build/dist/source/Pipe.js +2 -2
  9. package/build/dist/source/Ref.d.ts +2 -2
  10. package/build/dist/source/Ref.js +5 -5
  11. package/build/dist/source/System.d.ts +14 -14
  12. package/build/dist/source/System.js +22 -22
  13. package/build/dist/source/api.d.ts +9 -9
  14. package/build/dist/source/api.js +7 -7
  15. package/build/dist/source/core/Changeset.js +1 -1
  16. package/build/dist/source/core/Data.d.ts +1 -1
  17. package/build/dist/source/core/Indicator.d.ts +2 -2
  18. package/build/dist/source/core/Indicator.js +2 -2
  19. package/build/dist/source/core/Journal.d.ts +2 -2
  20. package/build/dist/source/core/Journal.js +2 -2
  21. package/build/dist/source/core/Mvcc.d.ts +10 -10
  22. package/build/dist/source/core/Mvcc.js +19 -19
  23. package/build/dist/source/core/MvccArray.d.ts +3 -3
  24. package/build/dist/source/core/MvccArray.js +4 -4
  25. package/build/dist/source/core/MvccMap.d.ts +3 -3
  26. package/build/dist/source/core/MvccMap.js +4 -4
  27. package/build/dist/source/core/MvccReconciliationList.d.ts +28 -0
  28. package/build/dist/source/core/MvccReconciliationList.js +26 -0
  29. package/build/dist/source/core/Operation.d.ts +8 -8
  30. package/build/dist/source/core/Operation.js +41 -41
  31. package/build/dist/source/core/Transaction.js +28 -28
  32. package/build/dist/source/core/TreeNode.d.ts +19 -19
  33. package/build/dist/source/core/TreeNode.js +58 -58
  34. package/build/dist/source/util/LinkedList.d.ts +52 -0
  35. package/build/dist/source/util/LinkedList.js +177 -0
  36. package/build/dist/source/util/LinkedListRenovation.d.ts +20 -0
  37. package/build/dist/source/util/LinkedListRenovation.js +134 -0
  38. package/build/dist/source/util/{ScriptedList.d.ts → ReconciliationList.d.ts} +17 -15
  39. package/build/dist/source/util/{ScriptedList.js → ReconciliationList.js} +91 -90
  40. package/package.json +10 -9
  41. package/build/dist/source/core/MvccMergeList.d.ts +0 -27
  42. package/build/dist/source/core/MvccMergeList.js +0 -25
@@ -1,20 +1,20 @@
1
1
  export { all, pause, proceedSyncOrAsync } from "./util/Utils.js";
2
2
  export { Uri } from "./util/Uri.js";
3
- export { ScriptedList } from "./util/ScriptedList.js";
3
+ export { ReconciliationList } from "./util/ReconciliationList.js";
4
4
  export { SealedArray } from "./util/SealedArray.js";
5
5
  export { SealedMap } from "./util/SealedMap.js";
6
6
  export { SealedSet } from "./util/SealedSet.js";
7
7
  export { LoggingLevel } from "./Options.js";
8
8
  export { Mode, Priority, Kind, Reentrance, Isolation } from "./Enums.js";
9
9
  export { Ref, ToggleRef, refs, toggleRefs, customToggleRefs } from "./Ref.js";
10
- export { AtomicObject, ObservableObject } from "./core/Mvcc.js";
11
- export { AtomicArray, ObservableArray } from "./core/MvccArray.js";
12
- export { AtomicMap, ObservableMap } from "./core/MvccMap.js";
10
+ export { TxObject, SxObject } from "./core/Mvcc.js";
11
+ export { TxArray, SxArray } from "./core/MvccArray.js";
12
+ export { TxMap, SxMap } from "./core/MvccMap.js";
13
13
  export { Changeset } from "./core/Changeset.js";
14
14
  export { Transaction } from "./core/Transaction.js";
15
15
  export { Indicator } from "./core/Indicator.js";
16
16
  export { Journal } from "./core/Journal.js";
17
- export { runAtomically, runNonReactively, runSensitively, runContextually, manageReactiveOperation, configureCurrentReactiveOperation, disposeObservableObject } from "./System.js";
18
- export { ReactiveSystem, observable, atomic, reactive, cached, options } from "./System.js";
19
- export { ReactiveOperationEx } from "./OperationEx.js";
17
+ export { runTransactional, runNonReactive, runSensitive, runContextual, manageReaction, configureCurrentReaction, disposeSignallingObject } from "./System.js";
18
+ export { ReactiveSystem, signal, transaction, reaction, cache, options } from "./System.js";
19
+ export { ReactionEx } from "./OperationEx.js";
20
20
  export { declare, derivative, launch, ReactiveTreeNode, BaseDriver, ReactiveTreeVariable } from "./core/TreeNode.js";
@@ -125,7 +125,7 @@ export class Changeset {
125
125
  }
126
126
  isNewObjectVersionRequired(h, ov, fk, existing, value, token) {
127
127
  if (this.sealed && ov.changeset !== EMPTY_OBJECT_VERSION.changeset)
128
- throw misuse(`observable property ${Dump.obj(h, fk)} can only be modified inside transaction`);
128
+ throw misuse(`signal property ${Dump.obj(h, fk)} can only be modified inside transaction`);
129
129
  if (fk !== Meta.Handle) {
130
130
  if (value !== Meta.Handle) {
131
131
  if (ov.changeset !== this || ov.former.objectVersion !== EMPTY_OBJECT_VERSION) {
@@ -14,7 +14,7 @@ export declare class ContentFootprint<T = any> {
14
14
  }
15
15
  export type OperationFootprint = {
16
16
  readonly order: number;
17
- readonly observables: Map<ContentFootprint, Subscription> | undefined;
17
+ readonly signals: Map<ContentFootprint, Subscription> | undefined;
18
18
  readonly obsoleteSince: number;
19
19
  hint(nop?: boolean): string;
20
20
  markObsoleteDueTo(footprint: ContentFootprint, fk: FieldKey, changeset: AbstractChangeset, h: ObjectHandle, outer: string, since: number, collector: Array<OperationFootprint>): void;
@@ -1,6 +1,6 @@
1
1
  import { Worker } from "../Worker.js";
2
- import { ObservableObject } from "./Mvcc.js";
3
- export declare abstract class Indicator extends ObservableObject {
2
+ import { SxObject } from "./Mvcc.js";
3
+ export declare abstract class Indicator extends SxObject {
4
4
  abstract readonly isBusy: boolean;
5
5
  abstract readonly counter: number;
6
6
  abstract readonly workers: ReadonlySet<Worker>;
@@ -8,9 +8,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { Isolation } from "../Enums.js";
11
- import { ObservableObject, Mvcc } from "./Mvcc.js";
11
+ import { SxObject, Mvcc } from "./Mvcc.js";
12
12
  import { Transaction } from "./Transaction.js";
13
- export class Indicator extends ObservableObject {
13
+ export class Indicator extends SxObject {
14
14
  static create(hint, activationDelay, deactivationDelay, durationResolution) {
15
15
  return IndicatorImpl.createImpl(hint, activationDelay, deactivationDelay, durationResolution);
16
16
  }
@@ -1,7 +1,7 @@
1
- import { ObservableObject } from "./Mvcc.js";
1
+ import { SxObject } from "./Mvcc.js";
2
2
  import { ObjectHandle, ObjectVersion, PatchSet } from "./Data.js";
3
3
  export type Saver = (patch: PatchSet) => Promise<void>;
4
- export declare abstract class Journal extends ObservableObject {
4
+ export declare abstract class Journal extends SxObject {
5
5
  abstract capacity: number;
6
6
  abstract readonly edits: ReadonlyArray<PatchSet>;
7
7
  abstract readonly unsaved: PatchSet;
@@ -1,11 +1,11 @@
1
1
  import { misuse } from "../util/Dbg.js";
2
2
  import { Isolation } from "../Enums.js";
3
- import { ObservableObject } from "./Mvcc.js";
3
+ import { SxObject } from "./Mvcc.js";
4
4
  import { Meta, ContentFootprint } from "./Data.js";
5
5
  import { Changeset, EMPTY_OBJECT_VERSION } from "./Changeset.js";
6
6
  import { Transaction } from "./Transaction.js";
7
7
  import { Sealant } from "../util/Sealant.js";
8
- export class Journal extends ObservableObject {
8
+ export class Journal extends SxObject {
9
9
  static create() { return new JournalImpl(); }
10
10
  }
11
11
  export class JournalImpl extends Journal {
@@ -6,13 +6,13 @@ import { FieldKey, ObjectHandle } from "./Data.js";
6
6
  import { Journal } from "./Journal.js";
7
7
  import { Indicator } from "./Indicator.js";
8
8
  export declare abstract class MvccObject {
9
- protected constructor(isObservable: boolean);
9
+ protected constructor(isSignal: boolean);
10
10
  [Symbol.toStringTag](): string;
11
11
  }
12
- export declare abstract class AtomicObject extends MvccObject {
12
+ export declare abstract class TxObject extends MvccObject {
13
13
  constructor();
14
14
  }
15
- export declare abstract class ObservableObject extends MvccObject {
15
+ export declare abstract class SxObject extends MvccObject {
16
16
  constructor();
17
17
  }
18
18
  export declare class OptionsImpl implements ReactivityOptions {
@@ -22,7 +22,7 @@ export declare class OptionsImpl implements ReactivityOptions {
22
22
  readonly isolation: Isolation;
23
23
  readonly order: number;
24
24
  readonly noSideEffects: boolean;
25
- readonly observableArgs: boolean;
25
+ readonly signalArgs: boolean;
26
26
  readonly throttling: number;
27
27
  readonly reentrance: Reentrance;
28
28
  readonly allowObsoleteToFinish: boolean;
@@ -38,10 +38,10 @@ export declare class Mvcc implements ProxyHandler<ObjectHandle> {
38
38
  static mainThreadBlockingWarningThreshold: number;
39
39
  static asyncActionDurationWarningThreshold: number;
40
40
  static sensitivity: boolean;
41
- static readonly atomic: Mvcc;
42
- static readonly observable: Mvcc;
43
- readonly isObservable: boolean;
44
- constructor(isObservable: boolean);
41
+ static readonly tx: Mvcc;
42
+ static readonly sx: Mvcc;
43
+ readonly isSignal: boolean;
44
+ constructor(isSignal: boolean);
45
45
  getPrototypeOf(h: ObjectHandle): object | null;
46
46
  get(h: ObjectHandle, fk: FieldKey, receiver: any): any;
47
47
  set(h: ObjectHandle, fk: FieldKey, value: any, receiver: any): boolean;
@@ -49,11 +49,11 @@ export declare class Mvcc implements ProxyHandler<ObjectHandle> {
49
49
  defineProperty?(h: ObjectHandle, name: string | symbol, attributes: PropertyDescriptor): boolean;
50
50
  getOwnPropertyDescriptor(h: ObjectHandle, fk: FieldKey): PropertyDescriptor | undefined;
51
51
  ownKeys(h: ObjectHandle): Array<string | symbol>;
52
- static decorateData(isObservable: boolean, proto: any, fk: FieldKey): any;
52
+ static decorateData(isSignal: boolean, proto: any, fk: FieldKey): any;
53
53
  static decorateOperation(implicit: boolean, decorator: Function, options: Partial<ReactivityOptions>, proto: any, member: FieldKey, pd: PropertyDescriptor | undefined): any;
54
54
  static decorateOperationParametrized(decorator: Function, options: Partial<ReactivityOptions>): F<any>;
55
55
  static acquireHandle(obj: any): ObjectHandle;
56
- static createHandleForMvccObject(proto: any, data: any, blank: any, hint: string, isObservable: boolean): ObjectHandle;
56
+ static createHandleForMvccObject(proto: any, data: any, blank: any, hint: string, isSignal: boolean): ObjectHandle;
57
57
  static setProfilingMode(isOn: boolean, options?: Partial<ProfilingOptions>): void;
58
58
  static sensitive<T>(sensitivity: boolean, func: F<T>, ...args: any[]): T;
59
59
  static setHint<T>(obj: T, hint: string | undefined): T;
@@ -4,10 +4,10 @@ import { Kind, Reentrance, Isolation } from "../Enums.js";
4
4
  import { ObjectVersion, ObjectHandle, ContentFootprint, Meta } from "./Data.js";
5
5
  import { Changeset, Dump, EMPTY_OBJECT_VERSION } from "./Changeset.js";
6
6
  export class MvccObject {
7
- constructor(isObservable) {
7
+ constructor(isSignal) {
8
8
  const proto = new.target.prototype;
9
9
  const initial = Meta.getFrom(proto, Meta.Initial);
10
- const h = Mvcc.createHandleForMvccObject(proto, this, initial, new.target.name, isObservable);
10
+ const h = Mvcc.createHandleForMvccObject(proto, this, initial, new.target.name, isSignal);
11
11
  return h.proxy;
12
12
  }
13
13
  [Symbol.toStringTag]() {
@@ -15,12 +15,12 @@ export class MvccObject {
15
15
  return Dump.obj(h);
16
16
  }
17
17
  }
18
- export class AtomicObject extends MvccObject {
18
+ export class TxObject extends MvccObject {
19
19
  constructor() {
20
20
  super(false);
21
21
  }
22
22
  }
23
- export class ObservableObject extends MvccObject {
23
+ export class SxObject extends MvccObject {
24
24
  constructor() {
25
25
  super(true);
26
26
  }
@@ -30,7 +30,7 @@ const DEFAULT_OPTIONS = Object.freeze({
30
30
  isolation: Isolation.joinToCurrentTransaction,
31
31
  order: 0,
32
32
  noSideEffects: false,
33
- observableArgs: false,
33
+ signalArgs: false,
34
34
  throttling: Number.MAX_SAFE_INTEGER,
35
35
  reentrance: Reentrance.preventWithError,
36
36
  allowObsoleteToFinish: false,
@@ -46,7 +46,7 @@ export class OptionsImpl {
46
46
  this.isolation = merge(DEFAULT_OPTIONS.isolation, existing.isolation, patch.isolation, implicit);
47
47
  this.order = merge(DEFAULT_OPTIONS.order, existing.order, patch.order, implicit);
48
48
  this.noSideEffects = merge(DEFAULT_OPTIONS.noSideEffects, existing.noSideEffects, patch.noSideEffects, implicit);
49
- this.observableArgs = merge(DEFAULT_OPTIONS.observableArgs, existing.observableArgs, patch.observableArgs, implicit);
49
+ this.signalArgs = merge(DEFAULT_OPTIONS.signalArgs, existing.signalArgs, patch.signalArgs, implicit);
50
50
  this.throttling = merge(DEFAULT_OPTIONS.throttling, existing.throttling, patch.throttling, implicit);
51
51
  this.reentrance = merge(DEFAULT_OPTIONS.reentrance, existing.reentrance, patch.reentrance, implicit);
52
52
  this.allowObsoleteToFinish = merge(DEFAULT_OPTIONS.allowObsoleteToFinish, existing.allowObsoleteToFinish, patch.allowObsoleteToFinish, implicit);
@@ -62,8 +62,8 @@ function merge(def, existing, patch, implicit) {
62
62
  return patch !== undefined && (existing === def || !implicit) ? patch : existing;
63
63
  }
64
64
  export class Mvcc {
65
- constructor(isObservable) {
66
- this.isObservable = isObservable;
65
+ constructor(isSignal) {
66
+ this.isSignal = isSignal;
67
67
  }
68
68
  getPrototypeOf(h) {
69
69
  return Reflect.getPrototypeOf(h.data);
@@ -75,7 +75,7 @@ export class Mvcc {
75
75
  const ov = cs.getObjectVersion(h, fk);
76
76
  result = ov.data[fk];
77
77
  if (result instanceof ContentFootprint && !result.isComputed) {
78
- if (this.isObservable)
78
+ if (this.isSignal)
79
79
  Changeset.markUsed(result, ov, fk, h, Kind.plain, false);
80
80
  result = result.content;
81
81
  }
@@ -122,16 +122,16 @@ export class Mvcc {
122
122
  }
123
123
  return result;
124
124
  }
125
- static decorateData(isObservable, proto, fk) {
126
- if (isObservable) {
125
+ static decorateData(isSignal, proto, fk) {
126
+ if (isSignal) {
127
127
  Meta.acquire(proto, Meta.Initial)[fk] = new ContentFootprint(undefined, 0);
128
128
  const get = function () {
129
129
  const h = Mvcc.acquireHandle(this);
130
- return Mvcc.observable.get(h, fk, this);
130
+ return Mvcc.sx.get(h, fk, this);
131
131
  };
132
132
  const set = function (value) {
133
133
  const h = Mvcc.acquireHandle(this);
134
- return Mvcc.observable.set(h, fk, value, this);
134
+ return Mvcc.sx.set(h, fk, value, this);
135
135
  };
136
136
  const enumerable = true;
137
137
  const configurable = false;
@@ -177,19 +177,19 @@ export class Mvcc {
177
177
  let h = obj[Meta.Handle];
178
178
  if (!h) {
179
179
  if (obj !== Object(obj) || Array.isArray(obj))
180
- throw misuse("only objects can be observable");
180
+ throw misuse("only objects can be signalling");
181
181
  const initial = Meta.getFrom(Object.getPrototypeOf(obj), Meta.Initial);
182
182
  const ov = new ObjectVersion(EMPTY_OBJECT_VERSION.changeset, EMPTY_OBJECT_VERSION, Object.assign({}, initial));
183
- h = new ObjectHandle(obj, obj, Mvcc.observable, ov, obj.constructor.name);
183
+ h = new ObjectHandle(obj, obj, Mvcc.sx, ov, obj.constructor.name);
184
184
  Meta.set(ov.data, Meta.Handle, h);
185
185
  Meta.set(obj, Meta.Handle, h);
186
186
  Meta.set(ov.data, Meta.Revision, new ContentFootprint(1, 0));
187
187
  }
188
188
  return h;
189
189
  }
190
- static createHandleForMvccObject(proto, data, blank, hint, isObservable) {
190
+ static createHandleForMvccObject(proto, data, blank, hint, isSignal) {
191
191
  const ctx = Changeset.edit();
192
- const mvcc = isObservable ? Mvcc.observable : Mvcc.atomic;
192
+ const mvcc = isSignal ? Mvcc.sx : Mvcc.tx;
193
193
  const h = new ObjectHandle(data, undefined, mvcc, EMPTY_OBJECT_VERSION, hint);
194
194
  ctx.getEditableObjectVersion(h, Meta.Handle, blank);
195
195
  if (!Mvcc.reactivityAutoStartDisabled)
@@ -238,8 +238,8 @@ Mvcc.repetitiveUsageWarningThreshold = Number.MAX_SAFE_INTEGER;
238
238
  Mvcc.mainThreadBlockingWarningThreshold = Number.MAX_SAFE_INTEGER;
239
239
  Mvcc.asyncActionDurationWarningThreshold = Number.MAX_SAFE_INTEGER;
240
240
  Mvcc.sensitivity = false;
241
- Mvcc.atomic = new Mvcc(false);
242
- Mvcc.observable = new Mvcc(true);
241
+ Mvcc.tx = new Mvcc(false);
242
+ Mvcc.sx = new Mvcc(true);
243
243
  Mvcc.createOperationDescriptor = function (h, fk, options) {
244
244
  throw misuse("this implementation of createOperationDescriptor should never be called");
245
245
  };
@@ -1,7 +1,7 @@
1
1
  import { MvccObject } from "./Mvcc.js";
2
2
  export declare class MvccArray<T> extends MvccObject {
3
3
  private impl;
4
- constructor(isObservable: boolean, array: Array<T>);
4
+ constructor(isSignalling: boolean, array: Array<T>);
5
5
  get length(): number;
6
6
  set length(n: number);
7
7
  getItem(n: number): T;
@@ -47,13 +47,13 @@ export declare class MvccArray<T> extends MvccObject {
47
47
  values(): IterableIterator<T>;
48
48
  private get mutable();
49
49
  }
50
- export declare class AtomicArray<T> extends MvccArray<T> {
50
+ export declare class TxArray<T> extends MvccArray<T> {
51
51
  constructor();
52
52
  constructor(arrayLength: number);
53
53
  constructor(arrayLength?: number);
54
54
  constructor(...items: T[]);
55
55
  }
56
- export declare class ObservableArray<T> extends MvccArray<T> {
56
+ export declare class SxArray<T> extends MvccArray<T> {
57
57
  constructor();
58
58
  constructor(arrayLength: number);
59
59
  constructor(arrayLength?: number);
@@ -1,8 +1,8 @@
1
1
  import { Sealant } from "../util/Sealant.js";
2
2
  import { MvccObject } from "./Mvcc.js";
3
3
  export class MvccArray extends MvccObject {
4
- constructor(isObservable, array) {
5
- super(isObservable);
4
+ constructor(isSignalling, array) {
5
+ super(isSignalling);
6
6
  this.impl = array;
7
7
  }
8
8
  get length() { return this.impl.length; }
@@ -46,12 +46,12 @@ export class MvccArray extends MvccObject {
46
46
  return this.impl;
47
47
  }
48
48
  }
49
- export class AtomicArray extends MvccArray {
49
+ export class TxArray extends MvccArray {
50
50
  constructor(...args) {
51
51
  super(false, new Array(...args));
52
52
  }
53
53
  }
54
- export class ObservableArray extends MvccArray {
54
+ export class SxArray extends MvccArray {
55
55
  constructor(...args) {
56
56
  super(true, new Array(...args));
57
57
  }
@@ -1,7 +1,7 @@
1
1
  import { MvccObject } from "./Mvcc.js";
2
2
  export declare class MvccMap<K, V> extends MvccObject {
3
3
  private impl;
4
- constructor(isObservable: boolean, map: Map<K, V>);
4
+ constructor(isSignalling: boolean, map: Map<K, V>);
5
5
  clear(): void;
6
6
  delete(key: K): boolean;
7
7
  forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void;
@@ -15,11 +15,11 @@ export declare class MvccMap<K, V> extends MvccObject {
15
15
  [Symbol.toStringTag](): string;
16
16
  private get mutable();
17
17
  }
18
- export declare class AtomicMap<K, V> extends MvccMap<K, V> {
18
+ export declare class TxMap<K, V> extends MvccMap<K, V> {
19
19
  constructor();
20
20
  constructor(iterable?: Iterable<readonly [K, V]> | null);
21
21
  }
22
- export declare class ObservableMap<K, V> extends MvccMap<K, V> {
22
+ export declare class SxMap<K, V> extends MvccMap<K, V> {
23
23
  constructor();
24
24
  constructor(iterable?: Iterable<readonly [K, V]> | null);
25
25
  }
@@ -1,8 +1,8 @@
1
1
  import { Sealant } from "../util/Sealant.js";
2
2
  import { MvccObject } from "./Mvcc.js";
3
3
  export class MvccMap extends MvccObject {
4
- constructor(isObservable, map) {
5
- super(isObservable);
4
+ constructor(isSignalling, map) {
5
+ super(isSignalling);
6
6
  this.impl = map;
7
7
  }
8
8
  clear() { this.mutable.clear(); }
@@ -23,12 +23,12 @@ export class MvccMap extends MvccObject {
23
23
  return this.impl;
24
24
  }
25
25
  }
26
- export class AtomicMap extends MvccMap {
26
+ export class TxMap extends MvccMap {
27
27
  constructor(args) {
28
28
  super(false, args !== undefined ? new Map(args) : new Map());
29
29
  }
30
30
  }
31
- export class ObservableMap extends MvccMap {
31
+ export class SxMap extends MvccMap {
32
32
  constructor(args) {
33
33
  super(true, args !== undefined ? new Map(args) : new Map());
34
34
  }
@@ -0,0 +1,28 @@
1
+ import { ReconciliationList, LinkedItem, ReconciliationListReader } from "../util/ReconciliationList.js";
2
+ import { SxObject } from "./Mvcc.js";
3
+ export declare abstract class SxReconciliationList<T> extends SxObject implements ReconciliationListReader<T> {
4
+ protected abstract impl: ReconciliationList<T>;
5
+ get isStrict(): boolean;
6
+ get count(): number;
7
+ get countOfAdded(): number;
8
+ get countOfRemoved(): number;
9
+ get isReconciliationInProgress(): boolean;
10
+ lookup(key: string): LinkedItem<T> | undefined;
11
+ tryReuse(key: string): LinkedItem<T> | undefined;
12
+ add(instance: T): LinkedItem<T>;
13
+ remove(item: LinkedItem<T>): void;
14
+ move(item: LinkedItem<T>, after: LinkedItem<T>): void;
15
+ beginReconciliation(): void;
16
+ endReconciliation(error?: unknown): void;
17
+ clearAddedAndRemovedLists(): void;
18
+ firstItem(): LinkedItem<T> | undefined;
19
+ lastItem(): LinkedItem<T> | undefined;
20
+ items(): Generator<LinkedItem<T>>;
21
+ itemsAdded(clear?: boolean): Generator<LinkedItem<T>>;
22
+ itemsRemoved(clear?: boolean): Generator<LinkedItem<T>>;
23
+ isAdded(item: LinkedItem<T>): boolean;
24
+ isMoved(item: LinkedItem<T>): boolean;
25
+ isRemoved(item: LinkedItem<T>): boolean;
26
+ isActual(item: LinkedItem<T>): boolean;
27
+ isExternal(item: LinkedItem<T>): boolean;
28
+ }
@@ -0,0 +1,26 @@
1
+ import { SxObject } from "./Mvcc.js";
2
+ export class SxReconciliationList extends SxObject {
3
+ get isStrict() { return this.impl.isStrict; }
4
+ get count() { return this.impl.count; }
5
+ get countOfAdded() { return this.impl.countOfAdded; }
6
+ get countOfRemoved() { return this.impl.countOfRemoved; }
7
+ get isReconciliationInProgress() { return this.impl.isReconciliationInProgress; }
8
+ lookup(key) { return this.impl.lookup(key); }
9
+ tryReuse(key) { return this.impl.tryReuse(key); }
10
+ add(instance) { return this.impl.add(instance); }
11
+ remove(item) { return this.impl.remove(item); }
12
+ move(item, after) { this.impl.move(item, after); }
13
+ beginReconciliation() { this.impl.beginReconciliation(); }
14
+ endReconciliation(error) { this.impl.endReconciliation(error); }
15
+ clearAddedAndRemovedLists() { this.impl.clearAddedAndRemoved(); }
16
+ firstItem() { return this.impl.firstItem(); }
17
+ lastItem() { return this.impl.lastItem(); }
18
+ items() { return this.impl.items(); }
19
+ itemsAdded(clear) { return this.impl.itemsAdded(clear); }
20
+ itemsRemoved(clear) { return this.impl.itemsRemoved(clear); }
21
+ isAdded(item) { return this.impl.isAdded(item); }
22
+ isMoved(item) { return this.impl.isMoved(item); }
23
+ isRemoved(item) { return this.impl.isRemoved(item); }
24
+ isActual(item) { return this.impl.isActual(item); }
25
+ isExternal(item) { return this.impl.isExternal(item); }
26
+ }
@@ -1,9 +1,9 @@
1
1
  import { F } from "../util/Utils.js";
2
- import { ReactiveOperation, ReactivityOptions } from "../Options.js";
2
+ import { Reaction, ReactivityOptions } from "../Options.js";
3
3
  import { FieldKey, ObjectHandle, ContentFootprint, OperationFootprint, Subscription, AbstractChangeset } from "./Data.js";
4
4
  import { Transaction } from "./Transaction.js";
5
5
  import { OptionsImpl } from "./Mvcc.js";
6
- export declare class ReactiveOperationImpl implements ReactiveOperation<any> {
6
+ export declare class ReactionImpl implements Reaction<any> {
7
7
  readonly ownerHandle: ObjectHandle;
8
8
  readonly fieldKey: FieldKey;
9
9
  configure(options: Partial<ReactivityOptions>): ReactivityOptions;
@@ -18,8 +18,8 @@ export declare class ReactiveOperationImpl implements ReactiveOperation<any> {
18
18
  pullLastResult(args?: any[]): any;
19
19
  constructor(h: ObjectHandle, fk: FieldKey);
20
20
  reuseOrRelaunch(weak: boolean, args: any[] | undefined): OperationFootprintImpl;
21
- static manageReactiveOperation(method: F<any>): ReactiveOperation<any>;
22
- static configureImpl(self: ReactiveOperationImpl | undefined, options: Partial<ReactivityOptions>): ReactivityOptions;
21
+ static manageReaction(method: F<any>): Reaction<any>;
22
+ static configureImpl(self: ReactionImpl | undefined, options: Partial<ReactivityOptions>): ReactivityOptions;
23
23
  static proceedWithinGivenLaunch<T>(footprint: OperationFootprintImpl | undefined, func: F<T>, ...args: any[]): T;
24
24
  static why(): string;
25
25
  static briefWhy(): string;
@@ -37,9 +37,9 @@ declare class OperationFootprintImpl extends ContentFootprint implements Operati
37
37
  static deferredReactions: Array<OperationFootprintImpl>;
38
38
  readonly margin: number;
39
39
  readonly transaction: Transaction;
40
- readonly descriptor: ReactiveOperationImpl;
40
+ readonly descriptor: ReactionImpl;
41
41
  readonly changeset: AbstractChangeset;
42
- observables: Map<ContentFootprint, Subscription> | undefined;
42
+ signals: Map<ContentFootprint, Subscription> | undefined;
43
43
  options: OptionsImpl;
44
44
  cause: string | undefined;
45
45
  args: any[];
@@ -49,7 +49,7 @@ declare class OperationFootprintImpl extends ContentFootprint implements Operati
49
49
  obsoleteDueTo: string | undefined;
50
50
  obsoleteSince: number;
51
51
  successor: OperationFootprintImpl | undefined;
52
- constructor(transaction: Transaction, descriptor: ReactiveOperationImpl, changeset: AbstractChangeset, former: OperationFootprintImpl | OptionsImpl, clone: boolean);
52
+ constructor(transaction: Transaction, descriptor: ReactionImpl, changeset: AbstractChangeset, former: OperationFootprintImpl | OptionsImpl, clone: boolean);
53
53
  get isComputed(): boolean;
54
54
  hint(): string;
55
55
  get order(): number;
@@ -81,7 +81,7 @@ declare class OperationFootprintImpl extends ContentFootprint implements Operati
81
81
  private static enqueueReactionsToRun;
82
82
  private static migrateContentFootprint;
83
83
  private static processQueuedReactions;
84
- private unsubscribeFromAllObservables;
84
+ private unsubscribeFromAllSignals;
85
85
  private subscribeTo;
86
86
  private static canSubscribeTo;
87
87
  private static createOperationDescriptor;