reactronic 0.24.124 → 0.24.126

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.
@@ -1,4 +1,4 @@
1
- import { ObservableObject } from './core/Mvcc.js';
1
+ import { ObservableObject } from "./core/Mvcc.js";
2
2
  export declare class Clock extends ObservableObject {
3
3
  hour: number;
4
4
  minute: number;
@@ -7,8 +7,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
- import { ObservableObject } from './core/Mvcc.js';
11
- import { transactional } from './RxSystem.js';
10
+ import { ObservableObject } from "./core/Mvcc.js";
11
+ import { transactional } from "./RxSystem.js";
12
12
  export class Clock extends ObservableObject {
13
13
  constructor(interval = 1000) {
14
14
  super();
@@ -13,7 +13,7 @@ export const LoggingLevel = {
13
13
  warning: true,
14
14
  gc: false,
15
15
  color: 37,
16
- prefix: '',
16
+ prefix: "",
17
17
  margin1: 0,
18
18
  margin2: 0,
19
19
  },
@@ -31,7 +31,7 @@ export const LoggingLevel = {
31
31
  warning: true,
32
32
  gc: false,
33
33
  color: 37,
34
- prefix: '',
34
+ prefix: "",
35
35
  margin1: 0,
36
36
  margin2: 0,
37
37
  },
@@ -49,7 +49,7 @@ export const LoggingLevel = {
49
49
  warning: true,
50
50
  gc: false,
51
51
  color: 37,
52
- prefix: '',
52
+ prefix: "",
53
53
  margin1: 0,
54
54
  margin2: 0,
55
55
  },
@@ -67,7 +67,7 @@ export const LoggingLevel = {
67
67
  warning: true,
68
68
  gc: false,
69
69
  color: 37,
70
- prefix: '',
70
+ prefix: "",
71
71
  margin1: 0,
72
72
  margin2: 0,
73
73
  },
@@ -85,7 +85,7 @@ export const LoggingLevel = {
85
85
  warning: true,
86
86
  gc: false,
87
87
  color: 37,
88
- prefix: '',
88
+ prefix: "",
89
89
  margin1: 0,
90
90
  margin2: 0,
91
91
  },
@@ -103,7 +103,7 @@ export const LoggingLevel = {
103
103
  warning: true,
104
104
  gc: false,
105
105
  color: 37,
106
- prefix: '',
106
+ prefix: "",
107
107
  margin1: 0,
108
108
  margin2: 0,
109
109
  },
@@ -1,9 +1,9 @@
1
- import { LoggingOptions } from './Logging.js';
2
- import { SeparationMode } from './core/Data.js';
3
- export { LoggingLevel } from './Logging.js';
4
- export type { LoggingOptions, ProfilingOptions } from './Logging.js';
5
- import { Journal } from './core/Journal.js';
6
- import { Monitor } from './core/Monitor.js';
1
+ import { LoggingOptions } from "./Logging.js";
2
+ import { SeparationMode } from "./core/Data.js";
3
+ export { LoggingLevel } from "./Logging.js";
4
+ export type { LoggingOptions, ProfilingOptions } from "./Logging.js";
5
+ import { Journal } from "./core/Journal.js";
6
+ import { Monitor } from "./core/Monitor.js";
7
7
  export type SnapshotOptions = {
8
8
  readonly hint?: string;
9
9
  readonly separation?: SeparationMode;
@@ -1,4 +1,4 @@
1
- export { LoggingLevel } from './Logging.js';
1
+ export { LoggingLevel } from "./Logging.js";
2
2
  export var Kind;
3
3
  (function (Kind) {
4
4
  Kind[Kind["Plain"] = 0] = "Plain";
@@ -1,4 +1,4 @@
1
- import { ObservableObject } from './core/Mvcc.js';
1
+ import { ObservableObject } from "./core/Mvcc.js";
2
2
  export declare abstract class Pipe<T> extends ObservableObject {
3
3
  abstract readonly capacity: number;
4
4
  abstract readonly count: number;
@@ -1,4 +1,4 @@
1
- import { ObservableObject } from './core/Mvcc.js';
1
+ import { ObservableObject } from "./core/Mvcc.js";
2
2
  export class Pipe extends ObservableObject {
3
- static create(hint, capacity) { throw new Error('not implemented'); }
3
+ static create(hint, capacity) { throw new Error("not implemented"); }
4
4
  }
@@ -1,5 +1,5 @@
1
- import { F } from './util/Utils.js';
2
- import { ObservableObject } from './core/Mvcc.js';
1
+ import { F } from "./util/Utils.js";
2
+ import { ObservableObject } from "./core/Mvcc.js";
3
3
  export declare class Reaction<T> extends ObservableObject {
4
4
  protected action: F<T>;
5
5
  constructor(action: F<T>);
@@ -7,8 +7,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
- import { ObservableObject } from './core/Mvcc.js';
11
- import { reactive } from './RxSystem.js';
10
+ import { ObservableObject } from "./core/Mvcc.js";
11
+ import { reactive } from "./RxSystem.js";
12
12
  export class Reaction extends ObservableObject {
13
13
  constructor(action) {
14
14
  super();
@@ -1,5 +1,5 @@
1
- import { Transaction } from './core/Transaction.js';
2
- import { unobs } from './RxSystem.js';
1
+ import { Transaction } from "./core/Transaction.js";
2
+ import { unobs } from "./RxSystem.js";
3
3
  export function refs(owner) {
4
4
  return new Proxy(owner, RefGettingProxy);
5
5
  }
@@ -35,7 +35,7 @@ export class Ref {
35
35
  return this.variable;
36
36
  }
37
37
  unobserve() {
38
- throw new Error('not implemented');
38
+ throw new Error("not implemented");
39
39
  }
40
40
  static sameRefs(v1, v2) {
41
41
  return v1.owner === v2.owner && v1.name === v2.name && v1.index === v2.index;
@@ -83,7 +83,7 @@ class CustomToggleRefGettingProxy {
83
83
  return new ToggleRef(obj, prop, this.value1, this.value2);
84
84
  }
85
85
  }
86
- Object.defineProperty(Object.prototype, '$$', {
86
+ Object.defineProperty(Object.prototype, "$$", {
87
87
  configurable: false, enumerable: false,
88
88
  get() {
89
89
  return new Proxy(this, RefGettingProxy);
@@ -1,5 +1,5 @@
1
- import { F } from './util/Utils.js';
2
- import { AbstractReaction, MemberOptions, LoggingOptions, ProfilingOptions } from './Options.js';
1
+ import { F } from "./util/Utils.js";
2
+ import { AbstractReaction, MemberOptions, LoggingOptions, ProfilingOptions } from "./Options.js";
3
3
  export declare class RxSystem {
4
4
  static why(brief?: boolean): string;
5
5
  static getReaction<T>(method: F<T>): AbstractReaction<T>;
@@ -1,10 +1,10 @@
1
- import { Log } from './util/Dbg.js';
2
- import { Kind } from './Options.js';
3
- import { Meta, ObjectHandle } from './core/Data.js';
4
- import { Changeset } from './core/Changeset.js';
5
- import { Mvcc } from './core/Mvcc.js';
6
- import { Transaction } from './core/Transaction.js';
7
- import { ReactionImpl } from './core/Reaction.js';
1
+ import { Log } from "./util/Dbg.js";
2
+ import { Kind } from "./Options.js";
3
+ import { Meta, ObjectHandle } from "./core/Data.js";
4
+ import { Changeset } from "./core/Changeset.js";
5
+ import { Mvcc } from "./core/Mvcc.js";
6
+ import { Transaction } from "./core/Transaction.js";
7
+ import { ReactionImpl } from "./core/Reaction.js";
8
8
  export class RxSystem {
9
9
  static why(brief = false) { return brief ? ReactionImpl.briefWhy() : ReactionImpl.why(); }
10
10
  static getReaction(method) { return ReactionImpl.getControllerOf(method); }
@@ -1,23 +1,23 @@
1
- export { all, pause } from './util/Utils.js';
2
- export { MergeList } from './util/MergeList.js';
3
- export type { MergedItem, MergeListReader } from './util/MergeList.js';
4
- export { SealedArray } from './util/SealedArray.js';
5
- export { SealedMap } from './util/SealedMap.js';
6
- export { SealedSet } from './util/SealedSet.js';
7
- export { Kind, Reentrance, LoggingLevel } from './Options.js';
8
- export type { AbstractReaction, MemberOptions, SnapshotOptions, LoggingOptions, ProfilingOptions } from './Options.js';
9
- export type { Worker } from './Worker.js';
10
- export { Ref, ToggleRef, refs, toggleRefs, customToggleRefs } from './Ref.js';
11
- export type { BoolOnly, GivenTypeOnly } from './Ref.js';
12
- export { TransactionalObject, ObservableObject } from './core/Mvcc.js';
13
- export { TransactionalArray, ObservableArray } from './core/MvccArray.js';
14
- export { TransactionalMap, ObservableMap } from './core/MvccMap.js';
15
- export { Changeset } from './core/Changeset.js';
16
- export { Transaction } from './core/Transaction.js';
17
- export { Monitor } from './core/Monitor.js';
18
- export { Journal } from './core/Journal.js';
19
- export { RxSystem, raw, obs, transactional, reactive, cached, transaction, unobs, sensitive, options } from './RxSystem.js';
20
- export { Reaction } from './Reaction.js';
21
- export { RxNode, Mode, Priority, BaseDriver, RxNodeVariable } from './core/RxNode.js';
22
- export type { Delegate, SimpleDelegate, RxNodeDecl, RxNodeDriver, RxNodeContext } from './core/RxNode.js';
23
- export { Clock } from './Clock.js';
1
+ export { all, pause } from "./util/Utils.js";
2
+ export { MergeList } from "./util/MergeList.js";
3
+ export type { MergedItem, MergeListReader } from "./util/MergeList.js";
4
+ export { SealedArray } from "./util/SealedArray.js";
5
+ export { SealedMap } from "./util/SealedMap.js";
6
+ export { SealedSet } from "./util/SealedSet.js";
7
+ export { Kind, Reentrance, LoggingLevel } from "./Options.js";
8
+ export type { AbstractReaction, MemberOptions, SnapshotOptions, LoggingOptions, ProfilingOptions } from "./Options.js";
9
+ export type { Worker } from "./Worker.js";
10
+ export { Ref, ToggleRef, refs, toggleRefs, customToggleRefs } from "./Ref.js";
11
+ export type { BoolOnly, GivenTypeOnly } from "./Ref.js";
12
+ export { TransactionalObject, ObservableObject } from "./core/Mvcc.js";
13
+ export { TransactionalArray, ObservableArray } from "./core/MvccArray.js";
14
+ export { TransactionalMap, ObservableMap } from "./core/MvccMap.js";
15
+ export { Changeset } from "./core/Changeset.js";
16
+ export { Transaction } from "./core/Transaction.js";
17
+ export { Monitor } from "./core/Monitor.js";
18
+ export { Journal } from "./core/Journal.js";
19
+ export { RxSystem, raw, obs, transactional, reactive, cached, transaction, unobs, sensitive, options } from "./RxSystem.js";
20
+ export { Reaction } from "./Reaction.js";
21
+ export { RxNode, Mode, Priority, BaseDriver, RxNodeVariable } from "./core/RxNode.js";
22
+ export type { Delegate, SimpleDelegate, RxNodeDecl, RxNodeDriver, RxNodeContext } from "./core/RxNode.js";
23
+ export { Clock } from "./Clock.js";
@@ -1,18 +1,18 @@
1
- export { all, pause } from './util/Utils.js';
2
- export { MergeList } from './util/MergeList.js';
3
- export { SealedArray } from './util/SealedArray.js';
4
- export { SealedMap } from './util/SealedMap.js';
5
- export { SealedSet } from './util/SealedSet.js';
6
- export { Kind, Reentrance, LoggingLevel } from './Options.js';
7
- export { Ref, ToggleRef, refs, toggleRefs, customToggleRefs } from './Ref.js';
8
- export { TransactionalObject, ObservableObject } from './core/Mvcc.js';
9
- export { TransactionalArray, ObservableArray } from './core/MvccArray.js';
10
- export { TransactionalMap, ObservableMap } from './core/MvccMap.js';
11
- export { Changeset } from './core/Changeset.js';
12
- export { Transaction } from './core/Transaction.js';
13
- export { Monitor } from './core/Monitor.js';
14
- export { Journal } from './core/Journal.js';
15
- export { RxSystem, raw, obs, transactional, reactive, cached, transaction, unobs, sensitive, options } from './RxSystem.js';
16
- export { Reaction } from './Reaction.js';
17
- export { RxNode, Mode, Priority, BaseDriver, RxNodeVariable } from './core/RxNode.js';
18
- export { Clock } from './Clock.js';
1
+ export { all, pause } from "./util/Utils.js";
2
+ export { MergeList } from "./util/MergeList.js";
3
+ export { SealedArray } from "./util/SealedArray.js";
4
+ export { SealedMap } from "./util/SealedMap.js";
5
+ export { SealedSet } from "./util/SealedSet.js";
6
+ export { Kind, Reentrance, LoggingLevel } from "./Options.js";
7
+ export { Ref, ToggleRef, refs, toggleRefs, customToggleRefs } from "./Ref.js";
8
+ export { TransactionalObject, ObservableObject } from "./core/Mvcc.js";
9
+ export { TransactionalArray, ObservableArray } from "./core/MvccArray.js";
10
+ export { TransactionalMap, ObservableMap } from "./core/MvccMap.js";
11
+ export { Changeset } from "./core/Changeset.js";
12
+ export { Transaction } from "./core/Transaction.js";
13
+ export { Monitor } from "./core/Monitor.js";
14
+ export { Journal } from "./core/Journal.js";
15
+ export { RxSystem, raw, obs, transactional, reactive, cached, transaction, unobs, sensitive, options } from "./RxSystem.js";
16
+ export { Reaction } from "./Reaction.js";
17
+ export { RxNode, Mode, Priority, BaseDriver, RxNodeVariable } from "./core/RxNode.js";
18
+ export { Clock } from "./Clock.js";
@@ -79,7 +79,7 @@ declare class Launch extends ValueSnapshot implements Observer {
79
79
  private static revokeAllSubscriptions;
80
80
  private static propagateMemberChangeThroughSubscriptions;
81
81
  private static enqueueReactiveFunctionsToRun;
82
- private static runQueuedReactiveFunctions;
82
+ private static processQueuedReactiveFunctions;
83
83
  private unsubscribeFromAllObservables;
84
84
  private subscribeTo;
85
85
  private static canSubscribeTo;
@@ -537,9 +537,9 @@ class Launch extends ValueSnapshot {
537
537
  for (const r of reactive)
538
538
  queue.push(r);
539
539
  if (isReactiveLoopRequired)
540
- ReactionImpl.proceedWithinGivenLaunch(undefined, Launch.runQueuedReactiveFunctions);
540
+ ReactionImpl.proceedWithinGivenLaunch(undefined, Launch.processQueuedReactiveFunctions);
541
541
  }
542
- static runQueuedReactiveFunctions() {
542
+ static processQueuedReactiveFunctions() {
543
543
  const queue = Launch.queuedReactiveFunctions;
544
544
  let i = 0;
545
545
  while (i < queue.length) {
@@ -45,6 +45,7 @@ export declare abstract class RxNode<E = unknown> {
45
45
  static get childrenShuffling(): boolean;
46
46
  static set childrenShuffling(value: boolean);
47
47
  static triggerUpdate(node: RxNode<any>, triggers: unknown): void;
48
+ static triggerFinalize(node: RxNode<any>): void;
48
49
  static updateNestedNodesThenDo(action: (error: unknown) => void): void;
49
50
  static markAsMounted(node: RxNode<any>, yes: boolean): void;
50
51
  static findMatchingHost<E = unknown, R = unknown>(node: RxNode<E>, match: SimpleDelegate<RxNode<E>, boolean>): RxNode<R> | undefined;
@@ -106,6 +106,10 @@ export class RxNode {
106
106
  triggerUpdateViaSeat(impl.seat);
107
107
  }
108
108
  }
109
+ static triggerFinalize(node) {
110
+ const impl = node;
111
+ triggerFinalization(impl.seat, true, true);
112
+ }
109
113
  static updateNestedNodesThenDo(action) {
110
114
  runUpdateNestedNodesThenDo(undefined, action);
111
115
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reactronic",
3
- "version": "0.24.124",
3
+ "version": "0.24.126",
4
4
  "description": "Reactronic - Transactional Reactive State Management",
5
5
  "publisher": "Nezaboodka Software",
6
6
  "license": "Apache-2.0",
@@ -43,9 +43,9 @@
43
43
  "typescript": "5.2.2"
44
44
  },
45
45
  "scripts": {
46
- "build": "eslint source/**/*.ts test/**/*.test.ts react/**/*.tsx && tsc",
47
- "fix": "eslint --fix source/**/*.ts test/**/*.test.ts react/**/*.tsx",
48
- "pack": "eslint source/**/*.ts test/**/*.test.ts react/**/*.tsx && tsc --sourceMap false --removeComments true",
46
+ "build": "eslint source/**.ts test/**.test.ts react/**.tsx && tsc",
47
+ "fix": "eslint --fix source/**.ts test/**.ts react/**.tsx",
48
+ "pack": "eslint source/**.ts test/**.test.ts react/**.tsx && tsc --sourceMap false --removeComments true",
49
49
  "test": "ava",
50
50
  "cover": "c8 ava && open build/coverage/index.html"
51
51
  }