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.
- package/build/dist/source/Buffer.js +2 -6
- package/build/dist/source/Controller.js +1 -5
- package/build/dist/source/Logging.js +1 -4
- package/build/dist/source/Options.js +5 -9
- package/build/dist/source/Ref.js +6 -11
- package/build/dist/source/Rx.js +46 -57
- package/build/dist/source/Worker.js +1 -2
- package/build/dist/source/api.js +13 -42
- package/build/dist/source/impl/Changeset.js +87 -92
- package/build/dist/source/impl/Data.js +10 -17
- package/build/dist/source/impl/Hooks.js +54 -62
- package/build/dist/source/impl/Journal.js +22 -27
- package/build/dist/source/impl/Meta.js +1 -5
- package/build/dist/source/impl/Monitor.js +9 -14
- package/build/dist/source/impl/Operation.js +150 -156
- package/build/dist/source/impl/Transaction.js +27 -31
- package/build/dist/source/util/Dbg.js +4 -11
- package/build/dist/source/util/Sealant.js +5 -9
- package/build/dist/source/util/SealedArray.js +10 -14
- package/build/dist/source/util/SealedMap.js +8 -12
- package/build/dist/source/util/SealedSet.js +8 -12
- package/build/dist/source/util/Utils.js +4 -11
- package/package.json +5 -5
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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,16 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
|
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
|
|
17
|
+
})(Reentrance || (Reentrance = {}));
|
package/build/dist/source/Ref.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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);
|
package/build/dist/source/Rx.js
CHANGED
|
@@ -1,58 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
|
16
|
-
static takeSnapshot(obj) { return
|
|
17
|
-
static dispose(obj) {
|
|
18
|
-
static get reactionsAutoStartDisabled() { return
|
|
19
|
-
static set reactionsAutoStartDisabled(value) {
|
|
20
|
-
static get isLogging() { return
|
|
21
|
-
static get loggingOptions() { return
|
|
22
|
-
static setLoggingMode(isOn, options) {
|
|
23
|
-
static setLoggingHint(obj, name) {
|
|
24
|
-
static getLoggingHint(obj, full = false) { return
|
|
25
|
-
static setProfilingMode(isOn, options) {
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
function
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
function
|
|
41
|
-
const opts = { kind:
|
|
42
|
-
return
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/build/dist/source/api.js
CHANGED
|
@@ -1,42 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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';
|