reactronic 0.22.318 → 0.22.320

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 CHANGED
@@ -302,7 +302,7 @@ function reaction(proto, prop, pd) // method only
302
302
  function cached(proto, prop, pd) // method only
303
303
  function options(value: Partial<MemberOptions>): F<any>
304
304
 
305
- function nonreactive<T>(func: F<T>, ...args: any[]): T
305
+ function unobservable<T>(func: F<T>, ...args: any[]): T
306
306
  function sensitive<T>(sensitivity: Sensitivity, func: F<T>, ...args: any[]): T
307
307
 
308
308
  // SnapshotOptions, MemberOptions, Kind, Reentrance, Monitor, LoggingOptions, ProfilingOptions
@@ -11,7 +11,7 @@ export declare class Ref<T = any> {
11
11
  constructor(owner: any, name: string, index?: number);
12
12
  get variable(): T;
13
13
  set variable(value: T);
14
- nonreactive(): T;
14
+ unobservable(): T;
15
15
  observe(): T;
16
16
  unobserve(): T;
17
17
  static to<O extends object = object>(owner: O): {
@@ -1,5 +1,5 @@
1
1
  import { Transaction } from './impl/Transaction';
2
- import { nonreactive } from './Rx';
2
+ import { unobservable } from './Rx';
3
3
  export class Ref {
4
4
  constructor(owner, name, index = -1) {
5
5
  this.owner = owner;
@@ -18,8 +18,8 @@ export class Ref {
18
18
  else
19
19
  this.owner[this.name][this.index] = value;
20
20
  }
21
- nonreactive() {
22
- return nonreactive(() => this.variable);
21
+ unobservable() {
22
+ return unobservable(() => this.variable);
23
23
  }
24
24
  observe() {
25
25
  return this.variable;
@@ -18,7 +18,7 @@ export declare class Rx {
18
18
  static getLoggingHint<T extends object>(obj: T, full?: boolean): string | undefined;
19
19
  static setProfilingMode(isOn: boolean, options?: Partial<ProfilingOptions>): void;
20
20
  }
21
- export declare function nonreactive<T>(func: F<T>, ...args: any[]): T;
21
+ export declare function unobservable<T>(func: F<T>, ...args: any[]): T;
22
22
  export declare function sensitive<T>(sensitivity: boolean, func: F<T>, ...args: any[]): T;
23
23
  export declare function raw(proto: object, prop: PropertyKey): any;
24
24
  export declare function transaction(proto: object, prop: PropertyKey, pd: PropertyDescriptor): any;
@@ -21,7 +21,7 @@ export class Rx {
21
21
  static getLoggingHint(obj, full = false) { return ObjectHandle.getHint(obj, full); }
22
22
  static setProfilingMode(isOn, options) { Mvcc.setProfilingMode(isOn, options); }
23
23
  }
24
- export function nonreactive(func, ...args) {
24
+ export function unobservable(func, ...args) {
25
25
  return OperationController.runWithin(undefined, func, ...args);
26
26
  }
27
27
  export function sensitive(sensitivity, func, ...args) {
@@ -14,4 +14,4 @@ export { Changeset } from './impl/Changeset';
14
14
  export { Transaction } from './impl/Transaction';
15
15
  export { Monitor } from './impl/Monitor';
16
16
  export { Journal } from './impl/Journal';
17
- export { Rx, nonreactive, sensitive, raw, transaction, reaction, cached, options } from './Rx';
17
+ export { Rx, unobservable, sensitive, raw, transaction, reaction, cached, options } from './Rx';
@@ -13,4 +13,4 @@ export { Changeset } from './impl/Changeset';
13
13
  export { Transaction } from './impl/Transaction';
14
14
  export { Monitor } from './impl/Monitor';
15
15
  export { Journal } from './impl/Journal';
16
- export { Rx, nonreactive, sensitive, raw, transaction, reaction, cached, options } from './Rx';
16
+ export { Rx, unobservable, sensitive, raw, transaction, reaction, cached, options } from './Rx';
@@ -9,7 +9,7 @@ export declare class OperationController extends Controller<any> {
9
9
  readonly memberName: MemberName;
10
10
  configure(options: Partial<MemberOptions>): MemberOptions;
11
11
  get options(): MemberOptions;
12
- get nonreactive(): any;
12
+ get unobservable(): any;
13
13
  get args(): ReadonlyArray<any>;
14
14
  get result(): any;
15
15
  get error(): boolean;
@@ -18,7 +18,7 @@ export class OperationController extends Controller {
18
18
  }
19
19
  configure(options) { return OperationController.configureImpl(this, options); }
20
20
  get options() { return this.peek(undefined).operation.options; }
21
- get nonreactive() { return this.peek(undefined).operation.content; }
21
+ get unobservable() { return this.peek(undefined).operation.content; }
22
22
  get args() { return this.use().operation.args; }
23
23
  get result() { return this.useOrRun(true, undefined).content; }
24
24
  get error() { return this.use().operation.error; }
@@ -36,7 +36,7 @@ export class OperationController extends Controller {
36
36
  && (!weak || op.cause === BOOT_CAUSE || !op.successor ||
37
37
  op.successor.transaction.isFinished)) {
38
38
  const outerOpts = (_a = Operation.current) === null || _a === void 0 ? void 0 : _a.options;
39
- const separation = weak || opts.separation || opts.kind === Kind.Reaction ||
39
+ const separation = weak || opts.separation !== false || opts.kind === Kind.Reaction ||
40
40
  (opts.kind === Kind.Transaction && outerOpts && (outerOpts.noSideEffects || outerOpts.kind === Kind.Cache)) ||
41
41
  (opts.kind === Kind.Cache && (oc.snapshot.changeset.sealed ||
42
42
  oc.snapshot.former.snapshot !== EMPTY_SNAPSHOT));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reactronic",
3
- "version": "0.22.318",
3
+ "version": "0.22.320",
4
4
  "description": "Reactronic - Transactional Reactive State Management",
5
5
  "type": "module",
6
6
  "main": "build/dist/source/api.js",
@@ -30,16 +30,16 @@
30
30
  },
31
31
  "homepage": "https://github.com/nezaboodka/reactronic/blob/master/README.md#readme",
32
32
  "devDependencies": {
33
- "@types/node": "18.0.5",
34
- "@types/react": "18.0.15",
35
- "@typescript-eslint/eslint-plugin": "5.30.6",
36
- "@typescript-eslint/parser": "5.30.6",
37
- "ava": "4.3.1",
38
- "c8": "7.11.3",
39
- "eslint": "8.19.0",
33
+ "@types/node": "18.7.18",
34
+ "@types/react": "18.0.20",
35
+ "@typescript-eslint/eslint-plugin": "5.37.0",
36
+ "@typescript-eslint/parser": "5.37.0",
37
+ "ava": "4.3.3",
38
+ "c8": "7.12.0",
39
+ "eslint": "8.23.1",
40
40
  "react": "18.2.0",
41
41
  "ts-node": "10.9.1",
42
- "typescript": "4.7.3"
42
+ "typescript": "4.8.2"
43
43
  },
44
44
  "scripts": {
45
45
  "build": "eslint source/**/*.ts test/**/*.ts react/**/*.tsx && tsc",