reactronic 0.22.310 → 0.22.311

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,8 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Buffer = void 0;
4
- const Hooks_1 = require("./impl/Hooks");
5
- class Buffer extends Hooks_1.ReactiveObject {
1
+ import { ReactiveObject } from './impl/Hooks';
2
+ export class Buffer extends ReactiveObject {
6
3
  static create(hint, capacity) { throw new Error('not implemented'); }
7
4
  }
8
- exports.Buffer = Buffer;
@@ -1,6 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Controller = void 0;
4
- class Controller {
1
+ export class Controller {
5
2
  }
6
- exports.Controller = Controller;
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LoggingLevel = void 0;
4
- exports.LoggingLevel = {
1
+ export const LoggingLevel = {
5
2
  Off: {
6
3
  enabled: false,
7
4
  transaction: false,
@@ -1,16 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Reentrance = exports.Kind = exports.LoggingLevel = void 0;
4
- var Logging_1 = require("./Logging");
5
- Object.defineProperty(exports, "LoggingLevel", { enumerable: true, get: function () { return Logging_1.LoggingLevel; } });
6
- var Kind;
1
+ export { LoggingLevel } from './Logging';
2
+ export var Kind;
7
3
  (function (Kind) {
8
4
  Kind[Kind["Plain"] = 0] = "Plain";
9
5
  Kind[Kind["Transaction"] = 1] = "Transaction";
10
6
  Kind[Kind["Reaction"] = 2] = "Reaction";
11
7
  Kind[Kind["Cache"] = 3] = "Cache";
12
- })(Kind = exports.Kind || (exports.Kind = {}));
13
- var Reentrance;
8
+ })(Kind || (Kind = {}));
9
+ export var Reentrance;
14
10
  (function (Reentrance) {
15
11
  Reentrance[Reentrance["PreventWithError"] = 1] = "PreventWithError";
16
12
  Reentrance[Reentrance["WaitAndRestart"] = 0] = "WaitAndRestart";
@@ -18,4 +14,4 @@ var Reentrance;
18
14
  Reentrance[Reentrance["CancelAndWaitPrevious"] = -2] = "CancelAndWaitPrevious";
19
15
  Reentrance[Reentrance["OverwritePrevious"] = -3] = "OverwritePrevious";
20
16
  Reentrance[Reentrance["RunSideBySide"] = -4] = "RunSideBySide";
21
- })(Reentrance = exports.Reentrance || (exports.Reentrance = {}));
17
+ })(Reentrance || (Reentrance = {}));
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ToggleRef = exports.Ref = void 0;
4
- const Transaction_1 = require("./impl/Transaction");
5
- const Rx_1 = require("./Rx");
6
- class Ref {
1
+ import { Transaction } from './impl/Transaction';
2
+ import { nonreactive } from './Rx';
3
+ export class Ref {
7
4
  constructor(owner, name, index = -1) {
8
5
  this.owner = owner;
9
6
  this.name = name;
@@ -22,7 +19,7 @@ class Ref {
22
19
  this.owner[this.name][this.index] = value;
23
20
  }
24
21
  nonreactive() {
25
- return (0, Rx_1.nonreactive)(() => this.value);
22
+ return nonreactive(() => this.value);
26
23
  }
27
24
  observe() {
28
25
  return this.value;
@@ -47,8 +44,7 @@ class Ref {
47
44
  return v1.owner.constructor === v2.owner.constructor && v1.name === v2.name && v1.index === v2.index;
48
45
  }
49
46
  }
50
- exports.Ref = Ref;
51
- class ToggleRef extends Ref {
47
+ export class ToggleRef extends Ref {
52
48
  constructor(owner, name, valueOn, valueOff) {
53
49
  super(owner, name);
54
50
  this.valueOn = valueOn;
@@ -57,7 +53,7 @@ class ToggleRef extends Ref {
57
53
  toggle() {
58
54
  const o = this.owner;
59
55
  const p = this.name;
60
- Transaction_1.Transaction.run({ hint: `toggle ${o.constructor.name}.${p}` }, () => {
56
+ Transaction.run({ hint: `toggle ${o.constructor.name}.${p}` }, () => {
61
57
  const v = o[p];
62
58
  const isOn = v === this.valueOn || (v instanceof Ref && this.valueOn instanceof Ref &&
63
59
  Ref.sameRefs(v, this.valueOn));
@@ -68,7 +64,6 @@ class ToggleRef extends Ref {
68
64
  });
69
65
  }
70
66
  }
71
- exports.ToggleRef = ToggleRef;
72
67
  const RefGettingProxy = {
73
68
  get: (obj, prop) => {
74
69
  return new Ref(obj, prop);
@@ -1,58 +1,47 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.options = exports.cached = exports.reaction = exports.transaction = exports.isnonreactive = exports.sensitive = exports.nonreactive = exports.Rx = void 0;
4
- const Dbg_1 = require("./util/Dbg");
5
- const Options_1 = require("./Options");
6
- const Data_1 = require("./impl/Data");
7
- const Changeset_1 = require("./impl/Changeset");
8
- const Hooks_1 = require("./impl/Hooks");
9
- const Operation_1 = require("./impl/Operation");
10
- class Rx {
11
- static getRevisionOf(obj) { return obj[Data_1.Meta.Revision]; }
12
- static why(brief = false) { return brief ? Operation_1.OperationController.briefWhy() : Operation_1.OperationController.why(); }
13
- static getController(method) { return Operation_1.OperationController.of(method); }
1
+ import { Log } from './util/Dbg';
2
+ import { Kind } from './Options';
3
+ import { Meta, ObjectHandle } from './impl/Data';
4
+ import { Changeset } from './impl/Changeset';
5
+ import { Hooks } from './impl/Hooks';
6
+ import { OperationController } from './impl/Operation';
7
+ export class Rx {
8
+ static getRevisionOf(obj) { return obj[Meta.Revision]; }
9
+ static why(brief = false) { return brief ? OperationController.briefWhy() : OperationController.why(); }
10
+ static getController(method) { return OperationController.of(method); }
14
11
  static pullLastResult(method, args) { return Rx.getController(method).pullLastResult(args); }
15
- static configureCurrentOperation(options) { return Operation_1.OperationController.configureImpl(undefined, options); }
16
- static takeSnapshot(obj) { return Changeset_1.Changeset.takeSnapshot(obj); }
17
- static dispose(obj) { Changeset_1.Changeset.dispose(obj); }
18
- static get reactionsAutoStartDisabled() { return Hooks_1.Hooks.reactionsAutoStartDisabled; }
19
- static set reactionsAutoStartDisabled(value) { Hooks_1.Hooks.reactionsAutoStartDisabled = value; }
20
- static get isLogging() { return Dbg_1.Log.isOn; }
21
- static get loggingOptions() { return Dbg_1.Log.opt; }
22
- static setLoggingMode(isOn, options) { Dbg_1.Log.setMode(isOn, options); }
23
- static setLoggingHint(obj, name) { Hooks_1.Hooks.setHint(obj, name); }
24
- static getLoggingHint(obj, full = false) { return Data_1.ObjectHandle.getHint(obj, full); }
25
- static setProfilingMode(isOn, options) { Hooks_1.Hooks.setProfilingMode(isOn, options); }
26
- }
27
- exports.Rx = Rx;
28
- function nonreactive(func, ...args) {
29
- return Operation_1.OperationController.runWithin(undefined, func, ...args);
30
- }
31
- exports.nonreactive = nonreactive;
32
- function sensitive(sensitivity, func, ...args) {
33
- return Hooks_1.Hooks.sensitive(sensitivity, func, ...args);
34
- }
35
- exports.sensitive = sensitive;
36
- function isnonreactive(proto, prop) {
37
- return Hooks_1.Hooks.decorateData(false, proto, prop);
38
- }
39
- exports.isnonreactive = isnonreactive;
40
- function transaction(proto, prop, pd) {
41
- const opts = { kind: Options_1.Kind.Transaction };
42
- return Hooks_1.Hooks.decorateOperation(true, transaction, opts, proto, prop, pd);
43
- }
44
- exports.transaction = transaction;
45
- function reaction(proto, prop, pd) {
46
- const opts = { kind: Options_1.Kind.Reaction, throttling: -1 };
47
- return Hooks_1.Hooks.decorateOperation(true, reaction, opts, proto, prop, pd);
48
- }
49
- exports.reaction = reaction;
50
- function cached(proto, prop, pd) {
51
- const opts = { kind: Options_1.Kind.Cache, noSideEffects: true };
52
- return Hooks_1.Hooks.decorateOperation(true, cached, opts, proto, prop, pd);
53
- }
54
- exports.cached = cached;
55
- function options(value) {
56
- return Hooks_1.Hooks.decorateOperationParametrized(options, value);
57
- }
58
- exports.options = options;
12
+ static configureCurrentOperation(options) { return OperationController.configureImpl(undefined, options); }
13
+ static takeSnapshot(obj) { return Changeset.takeSnapshot(obj); }
14
+ static dispose(obj) { Changeset.dispose(obj); }
15
+ static get reactionsAutoStartDisabled() { return Hooks.reactionsAutoStartDisabled; }
16
+ static set reactionsAutoStartDisabled(value) { Hooks.reactionsAutoStartDisabled = value; }
17
+ static get isLogging() { return Log.isOn; }
18
+ static get loggingOptions() { return Log.opt; }
19
+ static setLoggingMode(isOn, options) { Log.setMode(isOn, options); }
20
+ static setLoggingHint(obj, name) { Hooks.setHint(obj, name); }
21
+ static getLoggingHint(obj, full = false) { return ObjectHandle.getHint(obj, full); }
22
+ static setProfilingMode(isOn, options) { Hooks.setProfilingMode(isOn, options); }
23
+ }
24
+ export function nonreactive(func, ...args) {
25
+ return OperationController.runWithin(undefined, func, ...args);
26
+ }
27
+ export function sensitive(sensitivity, func, ...args) {
28
+ return Hooks.sensitive(sensitivity, func, ...args);
29
+ }
30
+ export function isnonreactive(proto, prop) {
31
+ return Hooks.decorateData(false, proto, prop);
32
+ }
33
+ export function transaction(proto, prop, pd) {
34
+ const opts = { kind: Kind.Transaction };
35
+ return Hooks.decorateOperation(true, transaction, opts, proto, prop, pd);
36
+ }
37
+ export function reaction(proto, prop, pd) {
38
+ const opts = { kind: Kind.Reaction, throttling: -1 };
39
+ return Hooks.decorateOperation(true, reaction, opts, proto, prop, pd);
40
+ }
41
+ export function cached(proto, prop, pd) {
42
+ const opts = { kind: Kind.Cache, noSideEffects: true };
43
+ return Hooks.decorateOperation(true, cached, opts, proto, prop, pd);
44
+ }
45
+ export function options(value) {
46
+ return Hooks.decorateOperationParametrized(options, value);
47
+ }
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,42 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.options = exports.cached = exports.reaction = exports.transaction = exports.isnonreactive = exports.sensitive = exports.nonreactive = exports.Rx = exports.Journal = exports.Monitor = exports.Transaction = exports.Changeset = exports.ReactiveMap = exports.ReactiveArray = exports.ReactiveObject = exports.ToggleRef = exports.Ref = exports.Controller = exports.LoggingLevel = exports.Reentrance = exports.Kind = exports.SealedSet = exports.SealedMap = exports.SealedArray = exports.pause = exports.all = void 0;
4
- var Utils_1 = require("./util/Utils");
5
- Object.defineProperty(exports, "all", { enumerable: true, get: function () { return Utils_1.all; } });
6
- Object.defineProperty(exports, "pause", { enumerable: true, get: function () { return Utils_1.pause; } });
7
- var SealedArray_1 = require("./util/SealedArray");
8
- Object.defineProperty(exports, "SealedArray", { enumerable: true, get: function () { return SealedArray_1.SealedArray; } });
9
- var SealedMap_1 = require("./util/SealedMap");
10
- Object.defineProperty(exports, "SealedMap", { enumerable: true, get: function () { return SealedMap_1.SealedMap; } });
11
- var SealedSet_1 = require("./util/SealedSet");
12
- Object.defineProperty(exports, "SealedSet", { enumerable: true, get: function () { return SealedSet_1.SealedSet; } });
13
- var Options_1 = require("./Options");
14
- Object.defineProperty(exports, "Kind", { enumerable: true, get: function () { return Options_1.Kind; } });
15
- Object.defineProperty(exports, "Reentrance", { enumerable: true, get: function () { return Options_1.Reentrance; } });
16
- Object.defineProperty(exports, "LoggingLevel", { enumerable: true, get: function () { return Options_1.LoggingLevel; } });
17
- var Controller_1 = require("./Controller");
18
- Object.defineProperty(exports, "Controller", { enumerable: true, get: function () { return Controller_1.Controller; } });
19
- var Ref_1 = require("./Ref");
20
- Object.defineProperty(exports, "Ref", { enumerable: true, get: function () { return Ref_1.Ref; } });
21
- Object.defineProperty(exports, "ToggleRef", { enumerable: true, get: function () { return Ref_1.ToggleRef; } });
22
- var Hooks_1 = require("./impl/Hooks");
23
- Object.defineProperty(exports, "ReactiveObject", { enumerable: true, get: function () { return Hooks_1.ReactiveObject; } });
24
- Object.defineProperty(exports, "ReactiveArray", { enumerable: true, get: function () { return Hooks_1.ReactiveArray; } });
25
- Object.defineProperty(exports, "ReactiveMap", { enumerable: true, get: function () { return Hooks_1.ReactiveMap; } });
26
- var Changeset_1 = require("./impl/Changeset");
27
- Object.defineProperty(exports, "Changeset", { enumerable: true, get: function () { return Changeset_1.Changeset; } });
28
- var Transaction_1 = require("./impl/Transaction");
29
- Object.defineProperty(exports, "Transaction", { enumerable: true, get: function () { return Transaction_1.Transaction; } });
30
- var Monitor_1 = require("./impl/Monitor");
31
- Object.defineProperty(exports, "Monitor", { enumerable: true, get: function () { return Monitor_1.Monitor; } });
32
- var Journal_1 = require("./impl/Journal");
33
- Object.defineProperty(exports, "Journal", { enumerable: true, get: function () { return Journal_1.Journal; } });
34
- var Rx_1 = require("./Rx");
35
- Object.defineProperty(exports, "Rx", { enumerable: true, get: function () { return Rx_1.Rx; } });
36
- Object.defineProperty(exports, "nonreactive", { enumerable: true, get: function () { return Rx_1.nonreactive; } });
37
- Object.defineProperty(exports, "sensitive", { enumerable: true, get: function () { return Rx_1.sensitive; } });
38
- Object.defineProperty(exports, "isnonreactive", { enumerable: true, get: function () { return Rx_1.isnonreactive; } });
39
- Object.defineProperty(exports, "transaction", { enumerable: true, get: function () { return Rx_1.transaction; } });
40
- Object.defineProperty(exports, "reaction", { enumerable: true, get: function () { return Rx_1.reaction; } });
41
- Object.defineProperty(exports, "cached", { enumerable: true, get: function () { return Rx_1.cached; } });
42
- Object.defineProperty(exports, "options", { enumerable: true, get: function () { return Rx_1.options; } });
1
+ export { all, pause } from './util/Utils';
2
+ export { SealedArray } from './util/SealedArray';
3
+ export { SealedMap } from './util/SealedMap';
4
+ export { SealedSet } from './util/SealedSet';
5
+ export { Kind, Reentrance, LoggingLevel } from './Options';
6
+ export { Controller } from './Controller';
7
+ export { Ref, ToggleRef } from './Ref';
8
+ export { ReactiveObject, ReactiveArray, ReactiveMap } from './impl/Hooks';
9
+ export { Changeset } from './impl/Changeset';
10
+ export { Transaction } from './impl/Transaction';
11
+ export { Monitor } from './impl/Monitor';
12
+ export { Journal } from './impl/Journal';
13
+ export { Rx, nonreactive, sensitive, isnonreactive, transaction, reaction, cached, options } from './Rx';