@dra2020/baseclient 1.0.75 → 1.0.76

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.
@@ -1016,14 +1016,11 @@ __exportStar(__webpack_require__(/*! ./dataflow */ "./lib/dataflow/dataflow.ts")
1016
1016
  // DataFlow: mechanism for setting up a data-flow dependency graph that gets computed on demand.
1017
1017
  //
1018
1018
  // Semantics are these:
1019
- // 1. The simplest "atomic" DataFlow object just has an id() and a value(). The id() is used to check for exact
1020
- // equivalence when determining if any dependents need to be recomputed. id() and value() might be the same
1021
- // for something that just creates a new whole object when recomputed. In other cases, id() might represent a
1022
- // hash or changestamp/timestamp that is distinct from the value(). The value may or may not be "ready" as well.
1023
- // If the value is not "ready", no dependents can be computed.
1019
+ // 1. The simplest "atomic" DataFlow object just has an id(). The id() is used to check for exact
1020
+ // equivalence when determining if any dependents need to be recomputed.
1024
1021
  // 2. A DataFlow object can record that it "uses" another DataFlow object. If it does, it can use a set of helper
1025
- // routines to track the state of its dependents. When its dependents are all ready(), it remembers their ids
1026
- // and can later test if they are stale.
1022
+ // routines to track the state of its dependents. When its dependents are "stale" (have changed) the computation
1023
+ // needs to be run.
1027
1024
  //
1028
1025
  //
1029
1026
  Object.defineProperty(exports, "__esModule", ({ value: true }));
@@ -1034,16 +1031,22 @@ class DataFlow {
1034
1031
  }
1035
1032
  // override in subclass
1036
1033
  id() { return null; }
1037
- value() { return null; }
1038
- uses(df) {
1039
- this.usesList.push({ df: df });
1034
+ uses(df, name) {
1035
+ this.usesList.push({ name: name, df: df });
1040
1036
  }
1041
1037
  usesStale() {
1042
1038
  let isstale = false;
1043
- this.usesList.forEach(ui => { if (ui.id !== ui.df.id())
1044
- isstale = true; });
1039
+ this.usesList.forEach(ui => {
1040
+ ui.wasstale = ui.id !== ui.df.id();
1041
+ if (ui.wasstale)
1042
+ isstale = true;
1043
+ });
1045
1044
  return isstale;
1046
1045
  }
1046
+ wasStale(name) {
1047
+ let ui = this.usesList.find((ui) => ui.name === name);
1048
+ return ui != null && ui.wasstale;
1049
+ }
1047
1050
  usesRemember() {
1048
1051
  this.usesList.forEach(ui => { ui.id = ui.df.id(); });
1049
1052
  }
@@ -1066,7 +1069,6 @@ class DataFlowCallback extends DataFlow {
1066
1069
  }
1067
1070
  id() { if (!this._value)
1068
1071
  this._value = this._cb(); return this._value; }
1069
- value() { return this.id(); }
1070
1072
  }
1071
1073
  exports.DataFlowCallback = DataFlowCallback;
1072
1074