reactronic 0.22.203 → 0.22.204

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.
@@ -5,6 +5,7 @@ export declare abstract class Meta {
5
5
  static readonly Initial: unique symbol;
6
6
  static readonly Reactions: unique symbol;
7
7
  static readonly Unobservable: unique symbol;
8
+ static readonly Undefined: unique symbol;
8
9
  static get<T>(obj: any, sym: symbol): T;
9
10
  static set(obj: any, sym: symbol, value: any): any;
10
11
  static acquire(proto: any, sym: symbol): any;
@@ -30,3 +30,4 @@ Meta.Disposed = Symbol('rxDisposed');
30
30
  Meta.Initial = Symbol('rxInitial');
31
31
  Meta.Reactions = Symbol('rxReactions');
32
32
  Meta.Unobservable = Symbol('rxUnobservable');
33
+ Meta.Undefined = Symbol('rxUndefined');
@@ -280,7 +280,7 @@ class Operation extends Data_1.Observable {
280
280
  const skip = !observable.isOperation &&
281
281
  snapshot === this.snapshot;
282
282
  if (!skip) {
283
- const why = `${Snapshot_1.Dump.rev2(holder, snapshot, memberName)} << ${outer}`;
283
+ const why = `${Snapshot_1.Dump.rev2(holder, snapshot, memberName, observable)} << ${outer}`;
284
284
  this.unsubscribeFromAllObservables();
285
285
  this.obsoleteDueTo = why;
286
286
  this.obsoleteSince = since;
@@ -628,6 +628,7 @@ class Operation extends Data_1.Observable {
628
628
  static init() {
629
629
  Object.freeze(BOOT_ARGS);
630
630
  Dbg_1.Log.getMergedLoggingOptions = getMergedLoggingOptions;
631
+ Snapshot_1.Dump.valueHint = valueHint;
631
632
  Snapshot_1.Snapshot.markUsed = Operation.markUsed;
632
633
  Snapshot_1.Snapshot.markEdited = Operation.markEdited;
633
634
  Snapshot_1.Snapshot.isConflicting = Operation.isConflicting;
@@ -674,10 +675,14 @@ function valueHint(value, m) {
674
675
  result = `${Snapshot_1.Dump.rev2(value.controller.ownHolder, value.snapshot, m)}`;
675
676
  else if (value === Data_1.Meta.Disposed)
676
677
  result = '<disposed>';
678
+ else if (value === Data_1.Meta.Undefined)
679
+ result = '◌';
680
+ else if (typeof (value) === 'string')
681
+ result = `"${value.toString().slice(0, 20)}"`;
677
682
  else if (value !== undefined && value !== null)
678
683
  result = value.toString().slice(0, 20);
679
684
  else
680
- result = '';
685
+ result = '';
681
686
  return result;
682
687
  }
683
688
  function getMergedLoggingOptions(local) {
@@ -49,8 +49,9 @@ export declare class Snapshot implements AbstractSnapshot {
49
49
  static _init(): void;
50
50
  }
51
51
  export declare class Dump {
52
- static obj(h: ObjectHolder | undefined, m?: MemberName | undefined, stamp?: number, snapshotId?: number, originSnapshotId?: number, typeless?: boolean): string;
53
- static rev2(h: ObjectHolder, s: AbstractSnapshot, m?: MemberName, value?: Observable): string;
52
+ static valueHint: (value: any, m?: PropertyKey | undefined) => string;
53
+ static obj(h: ObjectHolder | undefined, m?: MemberName | undefined, stamp?: number, snapshotId?: number, originSnapshotId?: number, value?: any): string;
54
+ static rev2(h: ObjectHolder, s: AbstractSnapshot, m?: MemberName, o?: Observable): string;
54
55
  static rev(r: ObjectRevision, m?: MemberName): string;
55
56
  static conflicts(conflicts: ObjectRevision[]): string;
56
57
  static conflictingMemberHint(m: MemberName, ours: ObjectRevision, theirs: ObjectRevision): string;
@@ -311,14 +311,17 @@ Snapshot.propagateAllChangesThroughSubscriptions = (snapshot) => { };
311
311
  Snapshot.revokeAllSubscriptions = (snapshot) => { };
312
312
  Snapshot.enqueueReactionsToRun = (reactions) => { };
313
313
  class Dump {
314
- static obj(h, m, stamp, snapshotId, originSnapshotId, typeless) {
314
+ static obj(h, m, stamp, snapshotId, originSnapshotId, value) {
315
315
  const member = m !== undefined ? `.${m.toString()}` : '';
316
316
  return h === undefined
317
317
  ? `boot${member}`
318
- : stamp === undefined ? `${h.hint}${member} #${h.id}` : `${h.hint}${member} #${h.id}t${snapshotId}v${stamp}${originSnapshotId !== undefined && originSnapshotId !== 0 ? `t${originSnapshotId}` : ''}`;
318
+ : stamp === undefined
319
+ ? `${h.hint}${member}${value !== undefined ? `[=${Dump.valueHint(value)}]` : ''} #${h.id}`
320
+ : `${h.hint}${member}${value !== undefined ? `[=${Dump.valueHint(value)}]` : ''} #${h.id}t${snapshotId}v${stamp}${originSnapshotId !== undefined && originSnapshotId !== 0 ? `t${originSnapshotId}` : ''}`;
319
321
  }
320
- static rev2(h, s, m, value) {
321
- return Dump.obj(h, m, s.timestamp, s.id, value === null || value === void 0 ? void 0 : value.originSnapshotId);
322
+ static rev2(h, s, m, o) {
323
+ var _a;
324
+ return Dump.obj(h, m, s.timestamp, s.id, o === null || o === void 0 ? void 0 : o.originSnapshotId, (_a = o === null || o === void 0 ? void 0 : o.value) !== null && _a !== void 0 ? _a : Data_1.Meta.Undefined);
322
325
  }
323
326
  static rev(r, m) {
324
327
  const h = Data_1.Meta.get(r.data, Data_1.Meta.Holder);
@@ -339,6 +342,7 @@ class Dump {
339
342
  }
340
343
  }
341
344
  exports.Dump = Dump;
345
+ Dump.valueHint = (value, m) => '???';
342
346
  exports.ROOT_REV = new Data_1.ObjectRevision(new Snapshot({ hint: '<root>' }), undefined, {});
343
347
  exports.DefaultSnapshotOptions = Object.freeze({
344
348
  hint: 'noname',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reactronic",
3
- "version": "0.22.203",
3
+ "version": "0.22.204",
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",