reactronic 0.21.528 → 0.21.529
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/README.md +2 -2
- package/build/dist/source/Ref.d.ts +2 -2
- package/build/dist/source/Ref.js +2 -2
- package/build/dist/source/{Reactronic.d.ts → Rx.d.ts} +1 -1
- package/build/dist/source/{Reactronic.js → Rx.js} +4 -4
- package/build/dist/source/api.d.ts +1 -1
- package/build/dist/source/api.js +11 -11
- package/build/dist/source/impl/Operation.js +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -200,7 +200,7 @@ class Component<P> extends React.Component<P> {
|
|
|
200
200
|
} // ensureUpToDate is subscribed to render
|
|
201
201
|
|
|
202
202
|
shouldComponentUpdate(): boolean {
|
|
203
|
-
return !
|
|
203
|
+
return !Rx.getController(this.render).isUpToDate
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
componentDidMount(): void {
|
|
@@ -208,7 +208,7 @@ class Component<P> extends React.Component<P> {
|
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
componentWillUnmount(): void {
|
|
211
|
-
standalone(
|
|
211
|
+
standalone(Rx.dispose, this)
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
```
|
|
@@ -14,10 +14,10 @@ export declare class Ref<T = any> {
|
|
|
14
14
|
nonreactiveValue(): T;
|
|
15
15
|
observe(): T;
|
|
16
16
|
unobserve(): T;
|
|
17
|
-
static to<O =
|
|
17
|
+
static to<O extends object = object>(owner: O): {
|
|
18
18
|
readonly [P in keyof O]-?: Ref<O[P]>;
|
|
19
19
|
};
|
|
20
|
-
static toToggle<O =
|
|
20
|
+
static toToggle<O extends object = object>(owner: O): {
|
|
21
21
|
readonly [P in keyof BoolOnly<O>]: ToggleRef<O[P]>;
|
|
22
22
|
};
|
|
23
23
|
static toCustomToggle<T, O extends object = any>(owner: O, value1: T, value2: T): {
|
package/build/dist/source/Ref.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ToggleRef = exports.Ref = void 0;
|
|
4
4
|
const Transaction_1 = require("./impl/Transaction");
|
|
5
|
-
const
|
|
5
|
+
const Rx_1 = require("./Rx");
|
|
6
6
|
class Ref {
|
|
7
7
|
constructor(owner, name, index = -1) {
|
|
8
8
|
this.owner = owner;
|
|
@@ -22,7 +22,7 @@ class Ref {
|
|
|
22
22
|
this.owner[this.name][this.index] = value;
|
|
23
23
|
}
|
|
24
24
|
nonreactiveValue() {
|
|
25
|
-
return (0,
|
|
25
|
+
return (0, Rx_1.nonreactive)(() => this.value);
|
|
26
26
|
}
|
|
27
27
|
observe() {
|
|
28
28
|
return this.value;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { F } from './util/Utils';
|
|
2
2
|
import { Controller } from './Controller';
|
|
3
3
|
import { MemberOptions, TraceOptions, ProfilingOptions } from './Options';
|
|
4
|
-
export declare class
|
|
4
|
+
export declare class Rx {
|
|
5
5
|
static why(brief?: boolean): string;
|
|
6
6
|
static getController<T>(method: F<T>): Controller<T>;
|
|
7
7
|
static pullLastResult<T>(method: F<Promise<T>>, args?: any[]): T | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.options = exports.cached = exports.reaction = exports.transaction = exports.unobservable = exports.sensitive = exports.standalone = exports.nonreactive = exports.
|
|
3
|
+
exports.options = exports.cached = exports.reaction = exports.transaction = exports.unobservable = exports.sensitive = exports.standalone = exports.nonreactive = exports.Rx = void 0;
|
|
4
4
|
const Dbg_1 = require("./util/Dbg");
|
|
5
5
|
const Options_1 = require("./Options");
|
|
6
6
|
const Data_1 = require("./impl/Data");
|
|
@@ -8,10 +8,10 @@ const Snapshot_1 = require("./impl/Snapshot");
|
|
|
8
8
|
const Hooks_1 = require("./impl/Hooks");
|
|
9
9
|
const Operation_1 = require("./impl/Operation");
|
|
10
10
|
const Transaction_1 = require("./impl/Transaction");
|
|
11
|
-
class
|
|
11
|
+
class Rx {
|
|
12
12
|
static why(brief = false) { return brief ? Operation_1.OperationController.briefWhy() : Operation_1.OperationController.why(); }
|
|
13
13
|
static getController(method) { return Operation_1.OperationController.of(method); }
|
|
14
|
-
static pullLastResult(method, args) { return
|
|
14
|
+
static pullLastResult(method, args) { return Rx.getController(method).pullLastResult(args); }
|
|
15
15
|
static configureCurrentOperation(options) { return Operation_1.OperationController.configureImpl(undefined, options); }
|
|
16
16
|
static takeSnapshot(obj) { return Snapshot_1.Snapshot.takeSnapshot(obj); }
|
|
17
17
|
static dispose(obj) { Snapshot_1.Snapshot.dispose(obj); }
|
|
@@ -24,7 +24,7 @@ class Reactronic {
|
|
|
24
24
|
static getTraceHint(obj, full = false) { return Data_1.ObjectHolder.getHint(obj, full); }
|
|
25
25
|
static setProfilingMode(enabled, options) { Hooks_1.Hooks.setProfilingMode(enabled, options); }
|
|
26
26
|
}
|
|
27
|
-
exports.
|
|
27
|
+
exports.Rx = Rx;
|
|
28
28
|
function nonreactive(func, ...args) {
|
|
29
29
|
return Operation_1.OperationController.runWithin(undefined, func, ...args);
|
|
30
30
|
}
|
|
@@ -11,4 +11,4 @@ export { Snapshot } from './impl/Snapshot';
|
|
|
11
11
|
export { Transaction } from './impl/Transaction';
|
|
12
12
|
export { Monitor } from './impl/Monitor';
|
|
13
13
|
export { TransactionJournal } from './impl/TransactionJournal';
|
|
14
|
-
export {
|
|
14
|
+
export { Rx, nonreactive, standalone, sensitive, unobservable, transaction, reaction, cached, options } from './Rx';
|
package/build/dist/source/api.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.options = exports.cached = exports.reaction = exports.transaction = exports.unobservable = exports.sensitive = exports.standalone = exports.nonreactive = exports.
|
|
3
|
+
exports.options = exports.cached = exports.reaction = exports.transaction = exports.unobservable = exports.sensitive = exports.standalone = exports.nonreactive = exports.Rx = exports.TransactionJournal = exports.Monitor = exports.Transaction = exports.Snapshot = exports.ObservableObject = exports.ToggleRef = exports.Ref = exports.Controller = exports.TraceLevel = exports.Reentrance = exports.Kind = exports.SealedSet = exports.SealedMap = exports.SealedArray = exports.pause = exports.all = void 0;
|
|
4
4
|
var Utils_1 = require("./util/Utils");
|
|
5
5
|
Object.defineProperty(exports, "all", { enumerable: true, get: function () { return Utils_1.all; } });
|
|
6
6
|
Object.defineProperty(exports, "pause", { enumerable: true, get: function () { return Utils_1.pause; } });
|
|
@@ -29,13 +29,13 @@ var Monitor_1 = require("./impl/Monitor");
|
|
|
29
29
|
Object.defineProperty(exports, "Monitor", { enumerable: true, get: function () { return Monitor_1.Monitor; } });
|
|
30
30
|
var TransactionJournal_1 = require("./impl/TransactionJournal");
|
|
31
31
|
Object.defineProperty(exports, "TransactionJournal", { enumerable: true, get: function () { return TransactionJournal_1.TransactionJournal; } });
|
|
32
|
-
var
|
|
33
|
-
Object.defineProperty(exports, "
|
|
34
|
-
Object.defineProperty(exports, "nonreactive", { enumerable: true, get: function () { return
|
|
35
|
-
Object.defineProperty(exports, "standalone", { enumerable: true, get: function () { return
|
|
36
|
-
Object.defineProperty(exports, "sensitive", { enumerable: true, get: function () { return
|
|
37
|
-
Object.defineProperty(exports, "unobservable", { enumerable: true, get: function () { return
|
|
38
|
-
Object.defineProperty(exports, "transaction", { enumerable: true, get: function () { return
|
|
39
|
-
Object.defineProperty(exports, "reaction", { enumerable: true, get: function () { return
|
|
40
|
-
Object.defineProperty(exports, "cached", { enumerable: true, get: function () { return
|
|
41
|
-
Object.defineProperty(exports, "options", { enumerable: true, get: function () { return
|
|
32
|
+
var Rx_1 = require("./Rx");
|
|
33
|
+
Object.defineProperty(exports, "Rx", { enumerable: true, get: function () { return Rx_1.Rx; } });
|
|
34
|
+
Object.defineProperty(exports, "nonreactive", { enumerable: true, get: function () { return Rx_1.nonreactive; } });
|
|
35
|
+
Object.defineProperty(exports, "standalone", { enumerable: true, get: function () { return Rx_1.standalone; } });
|
|
36
|
+
Object.defineProperty(exports, "sensitive", { enumerable: true, get: function () { return Rx_1.sensitive; } });
|
|
37
|
+
Object.defineProperty(exports, "unobservable", { enumerable: true, get: function () { return Rx_1.unobservable; } });
|
|
38
|
+
Object.defineProperty(exports, "transaction", { enumerable: true, get: function () { return Rx_1.transaction; } });
|
|
39
|
+
Object.defineProperty(exports, "reaction", { enumerable: true, get: function () { return Rx_1.reaction; } });
|
|
40
|
+
Object.defineProperty(exports, "cached", { enumerable: true, get: function () { return Rx_1.cached; } });
|
|
41
|
+
Object.defineProperty(exports, "options", { enumerable: true, get: function () { return Rx_1.options; } });
|
|
@@ -102,7 +102,7 @@ class OperationController extends Controller_1.Controller {
|
|
|
102
102
|
}
|
|
103
103
|
static dependencies() {
|
|
104
104
|
const op = Operation.current;
|
|
105
|
-
return op ? op.dependencies() : ['
|
|
105
|
+
return op ? op.dependencies() : ['Rx.dependencies should be called from inside of reactive method'];
|
|
106
106
|
}
|
|
107
107
|
peek(args) {
|
|
108
108
|
const ctx = Snapshot_1.Snapshot.current();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reactronic",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.529",
|
|
4
4
|
"description": "Reactronic - Transactional Reactive State Management",
|
|
5
5
|
"main": "build/dist/source/api.js",
|
|
6
6
|
"types": "build/dist/source/api.d.ts",
|
|
@@ -29,17 +29,17 @@
|
|
|
29
29
|
},
|
|
30
30
|
"homepage": "https://github.com/nezaboodka/reactronic/blob/master/README.md#readme",
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@types/node": "
|
|
32
|
+
"@types/node": "17.0.0",
|
|
33
33
|
"@types/react": "17.0.37",
|
|
34
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
35
|
-
"@typescript-eslint/parser": "5.
|
|
34
|
+
"@typescript-eslint/eslint-plugin": "5.7.0",
|
|
35
|
+
"@typescript-eslint/parser": "5.7.0",
|
|
36
36
|
"ava": "3.15.0",
|
|
37
|
-
"eslint": "8.
|
|
37
|
+
"eslint": "8.4.1",
|
|
38
38
|
"nyc": "15.1.0",
|
|
39
39
|
"react": "17.0.2",
|
|
40
40
|
"ts-node": "10.4.0",
|
|
41
41
|
"tsconfig-paths": "3.12.0",
|
|
42
|
-
"typescript": "4.4
|
|
42
|
+
"typescript": "4.5.4"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "eslint source/**/*.ts test/**/*.ts react/**/*.tsx && tsc",
|