@dra2020/baseclient 1.0.72 → 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.
package/dist/all/all.d.ts CHANGED
@@ -24,3 +24,5 @@ import * as CSV from '../csv/all';
24
24
  export { CSV };
25
25
  import * as Colors from '../colors/colors';
26
26
  export { Colors };
27
+ import * as DataFlow from '../dataflow/all';
28
+ export { DataFlow };
@@ -39,7 +39,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
39
39
  return result;
40
40
  };
41
41
  Object.defineProperty(exports, "__esModule", ({ value: true }));
42
- exports.Colors = exports.CSV = exports.Emit = exports.G = exports.FilterExpr = exports.OTE = exports.OT = exports.LogClient = exports.LogAbstract = exports.Poly = exports.FSM = exports.Context = exports.Util = void 0;
42
+ exports.DataFlow = exports.Colors = exports.CSV = exports.Emit = exports.G = exports.FilterExpr = exports.OTE = exports.OT = exports.LogClient = exports.LogAbstract = exports.Poly = exports.FSM = exports.Context = exports.Util = void 0;
43
43
  // Client and Server
44
44
  const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
45
45
  exports.Util = Util;
@@ -67,6 +67,8 @@ const CSV = __importStar(__webpack_require__(/*! ../csv/all */ "./lib/csv/all.ts
67
67
  exports.CSV = CSV;
68
68
  const Colors = __importStar(__webpack_require__(/*! ../colors/colors */ "./lib/colors/colors.ts"));
69
69
  exports.Colors = Colors;
70
+ const DataFlow = __importStar(__webpack_require__(/*! ../dataflow/all */ "./lib/dataflow/all.ts"));
71
+ exports.DataFlow = DataFlow;
70
72
 
71
73
 
72
74
  /***/ }),
@@ -978,6 +980,99 @@ class ParseOne {
978
980
  exports.ParseOne = ParseOne;
979
981
 
980
982
 
983
+ /***/ }),
984
+
985
+ /***/ "./lib/dataflow/all.ts":
986
+ /*!*****************************!*\
987
+ !*** ./lib/dataflow/all.ts ***!
988
+ \*****************************/
989
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
990
+
991
+
992
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
993
+ if (k2 === undefined) k2 = k;
994
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
995
+ }) : (function(o, m, k, k2) {
996
+ if (k2 === undefined) k2 = k;
997
+ o[k2] = m[k];
998
+ }));
999
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
1000
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1001
+ };
1002
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1003
+ __exportStar(__webpack_require__(/*! ./dataflow */ "./lib/dataflow/dataflow.ts"), exports);
1004
+
1005
+
1006
+ /***/ }),
1007
+
1008
+ /***/ "./lib/dataflow/dataflow.ts":
1009
+ /*!**********************************!*\
1010
+ !*** ./lib/dataflow/dataflow.ts ***!
1011
+ \**********************************/
1012
+ /***/ ((__unused_webpack_module, exports) => {
1013
+
1014
+
1015
+ //
1016
+ // DataFlow: mechanism for setting up a data-flow dependency graph that gets computed on demand.
1017
+ //
1018
+ // Semantics are these:
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.
1021
+ // 2. A DataFlow object can record that it "uses" another DataFlow object. If it does, it can use a set of helper
1022
+ // routines to track the state of its dependents. When its dependents are "stale" (have changed) the computation
1023
+ // needs to be run.
1024
+ //
1025
+ //
1026
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1027
+ exports.DataFlowCallback = exports.DataFlow = void 0;
1028
+ class DataFlow {
1029
+ constructor() {
1030
+ this.usesList = [];
1031
+ }
1032
+ // override in subclass
1033
+ id() { return null; }
1034
+ uses(df, name) {
1035
+ this.usesList.push({ name: name, df: df });
1036
+ }
1037
+ usesStale() {
1038
+ let isstale = false;
1039
+ this.usesList.forEach(ui => {
1040
+ ui.wasstale = ui.id !== ui.df.id();
1041
+ if (ui.wasstale)
1042
+ isstale = true;
1043
+ });
1044
+ return isstale;
1045
+ }
1046
+ wasStale(name) {
1047
+ let ui = this.usesList.find((ui) => ui.name === name);
1048
+ return ui != null && ui.wasstale;
1049
+ }
1050
+ usesRemember() {
1051
+ this.usesList.forEach(ui => { ui.id = ui.df.id(); });
1052
+ }
1053
+ ifcompute() {
1054
+ if (this.usesStale()) {
1055
+ this.usesRemember();
1056
+ this.compute();
1057
+ }
1058
+ }
1059
+ compute() {
1060
+ }
1061
+ }
1062
+ exports.DataFlow = DataFlow;
1063
+ // Takes callback that, eventually, returns non-null. The return value is both the value and the id.
1064
+ // Once the value returns non-null, the callback is never called again.
1065
+ class DataFlowCallback extends DataFlow {
1066
+ constructor(cb) {
1067
+ super();
1068
+ this._cb = cb;
1069
+ }
1070
+ id() { if (!this._value)
1071
+ this._value = this._cb(); return this._value; }
1072
+ }
1073
+ exports.DataFlowCallback = DataFlowCallback;
1074
+
1075
+
981
1076
  /***/ }),
982
1077
 
983
1078
  /***/ "./lib/emit/all.ts":