targetj 1.0.256 → 1.0.257

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.
@@ -1,4 +1,9 @@
1
1
  var _excluded = ["url", "cacheId"];
2
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
3
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
4
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
5
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
6
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
2
7
  function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
3
8
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
9
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
@@ -20,6 +25,7 @@ import { $Dom } from "./$Dom.js";
20
25
  import { TUtil } from "./TUtil.js";
21
26
  import { getRunScheduler } from "./App.js";
22
27
  import { TargetUtil } from "./TargetUtil.js";
28
+ import { StateUtil } from "./StateUtil.js";
23
29
 
24
30
  /**
25
31
  * It provides a central place for managing fetching of external APIs and images.
@@ -33,16 +39,19 @@ var LoadingManager = /*#__PURE__*/function () {
33
39
  this.fetchingImageMap = {};
34
40
  this.targetPageKeyMap = new WeakMap();
35
41
  this.fetchSeq = 0;
42
+ this.runtimeEpoch = 0;
36
43
  }
37
44
  return _createClass(LoadingManager, [{
38
45
  key: "clear",
39
46
  value: function clear() {
47
+ this.runtimeEpoch++;
40
48
  this.fetchingAPIMap = {};
41
49
  this.fetchingImageMap = {};
42
50
  }
43
51
  }, {
44
52
  key: "clearAll",
45
53
  value: function clearAll() {
54
+ this.runtimeEpoch++;
46
55
  this.cacheMap = {};
47
56
  this.tmodelKeyMap = {};
48
57
  this.fetchingAPIMap = {};
@@ -68,7 +77,7 @@ var LoadingManager = /*#__PURE__*/function () {
68
77
  }
69
78
  }, {
70
79
  key: "fetchCommon",
71
- value: function fetchCommon(fetchId, cacheId, tmodel, fetchMap, fetchFn) {
80
+ value: function fetchCommon(fetchId, cacheId, tmodel, fetchMap, request, fetchFn) {
72
81
  TargetUtil.markFetchAction(tmodel);
73
82
  var pageKey = document.URL;
74
83
  var targetName = tmodel.key;
@@ -78,28 +87,32 @@ var LoadingManager = /*#__PURE__*/function () {
78
87
  fetchMap[fetchId] = {
79
88
  fetchId: fetchId,
80
89
  cacheId: cacheId,
90
+ request: request,
81
91
  startTime: TUtil.now(),
92
+ epoch: this.runtimeEpoch,
82
93
  targets: [{
83
94
  tmodel: tmodel,
84
- targetName: tmodel.key
95
+ targetName: targetName
85
96
  }],
86
97
  fetchMap: fetchMap
87
98
  };
88
- fetchFn();
99
+ fetchFn(fetchMap[fetchId]);
89
100
  }
90
101
  } else if (!fetchMap[fetchId]) {
91
102
  fetchMap[fetchId] = {
92
103
  fetchId: fetchId,
93
104
  cacheId: cacheId,
105
+ request: request,
94
106
  startTime: TUtil.now(),
107
+ epoch: this.runtimeEpoch,
95
108
  targets: [{
96
109
  tmodel: tmodel,
97
- targetName: tmodel.key
110
+ targetName: targetName
98
111
  }],
99
112
  fetchMap: fetchMap
100
113
  };
101
114
  }
102
- this.addToTModelKeyMap(tmodel, tmodel.key, fetchId, cacheId, fetchMap);
115
+ this.addToTModelKeyMap(tmodel, targetName, fetchId, cacheId, fetchMap);
103
116
  return fetchId;
104
117
  }
105
118
  }, {
@@ -123,8 +136,13 @@ var LoadingManager = /*#__PURE__*/function () {
123
136
  value: function fetchOne(tmodel, url, query, cacheId) {
124
137
  var _this2 = this;
125
138
  var fetchId = this.getFetchKey(tmodel, url, query);
126
- this.fetchCommon(fetchId, cacheId, tmodel, this.fetchingAPIMap, function () {
127
- _this2.ajaxAPI(url, query, _this2.fetchingAPIMap[fetchId]);
139
+ var request = {
140
+ type: "api",
141
+ url: url,
142
+ query: StateUtil.encodeValue(query)
143
+ };
144
+ this.fetchCommon(fetchId, cacheId, tmodel, this.fetchingAPIMap, request, function (fetchStatus) {
145
+ return _this2.ajaxAPI(url, query, fetchStatus);
128
146
  });
129
147
  }
130
148
  }, {
@@ -132,10 +150,14 @@ var LoadingManager = /*#__PURE__*/function () {
132
150
  value: function fetchImage(tmodel, url, cacheId) {
133
151
  var _this3 = this;
134
152
  var urls = Array.isArray(url) ? url : [url];
135
- urls.forEach(function (singleUrl) {
136
- var fetchId = _this3.getFetchKey(tmodel, singleUrl);
137
- _this3.fetchCommon(fetchId, cacheId, tmodel, _this3.fetchingImageMap, function () {
138
- _this3.loadImage(singleUrl, _this3.fetchingImageMap[fetchId]);
153
+ urls.forEach(function (src) {
154
+ var fetchId = _this3.getFetchKey(tmodel, src);
155
+ var request = {
156
+ type: "image",
157
+ src: src
158
+ };
159
+ _this3.fetchCommon(fetchId, cacheId, tmodel, _this3.fetchingImageMap, request, function (fetchStatus) {
160
+ return _this3.loadImage(src, fetchStatus);
139
161
  });
140
162
  });
141
163
  }
@@ -151,37 +173,70 @@ var LoadingManager = /*#__PURE__*/function () {
151
173
  var pageKey = this.getTargetPageKey(tmodel, targetName);
152
174
  return "".concat(pageKey, "_").concat(tmodel.oid, "_").concat(targetName);
153
175
  }
176
+ }, {
177
+ key: "createTModelEntry",
178
+ value: function createTModelEntry(tmodel, targetName) {
179
+ return {
180
+ pageKey: this.getTargetPageKey(tmodel, targetName),
181
+ oid: tmodel.oid,
182
+ targetName: targetName,
183
+ fetchMap: {},
184
+ entryCount: 0,
185
+ resultCount: 0,
186
+ errorCount: 0,
187
+ activeIndex: 0,
188
+ accessIndex: 0
189
+ };
190
+ }
154
191
  }, {
155
192
  key: "addToTModelKeyMap",
156
193
  value: function addToTModelKeyMap(tmodel, targetName, fetchId, cacheId, fetchMap) {
157
194
  var key = this.getTModelKey(tmodel, targetName);
158
195
  var loadTargetName = TUtil.getLoadTargetName(targetName);
159
196
  var loadingComplete = this.isLoadingComplete(tmodel, targetName);
160
- if (loadingComplete || !this.tmodelKeyMap[key] || !tmodel.val(loadTargetName)) {
161
- var _this$tmodelKeyMap, _this$tmodelKeyMap$ke;
162
- (_this$tmodelKeyMap$ke = (_this$tmodelKeyMap = this.tmodelKeyMap)[key]) !== null && _this$tmodelKeyMap$ke !== void 0 ? _this$tmodelKeyMap$ke : _this$tmodelKeyMap[key] = {
163
- fetchMap: {},
164
- entryCount: 0,
165
- resultCount: 0,
166
- errorCount: 0,
167
- activeIndex: 0,
168
- accessIndex: 0
169
- };
197
+ var modelEntry = this.tmodelKeyMap[key];
198
+ if (loadingComplete || !modelEntry || !Array.isArray(tmodel.val(loadTargetName))) {
199
+ modelEntry = this.createTModelEntry(tmodel, targetName);
200
+ this.tmodelKeyMap[key] = modelEntry;
170
201
  tmodel.val(loadTargetName, []);
171
202
  }
172
- if (!this.tmodelKeyMap[key].fetchMap[fetchId]) {
173
- this.tmodelKeyMap[key].fetchMap[fetchId] = {
174
- fetchId: fetchId
175
- };
176
- }
177
- this.tmodelKeyMap[key].fetchMap[fetchId].order = this.tmodelKeyMap[key].entryCount;
178
- this.tmodelKeyMap[key].entryCount++;
203
+ modelEntry.fetchMap[fetchId] = {
204
+ fetchId: fetchId,
205
+ order: modelEntry.entryCount
206
+ };
207
+ modelEntry.entryCount++;
179
208
  tmodel.val(loadTargetName).push(undefined);
180
209
  if (cacheId && this.isFetched(cacheId)) {
181
210
  fetchMap[fetchId].startTime = TUtil.now();
182
211
  this.handleSuccess(fetchMap[fetchId], this.cacheMap[cacheId].result);
183
212
  }
184
213
  }
214
+ }, {
215
+ key: "getPendingRequestSnapshots",
216
+ value: function getPendingRequestSnapshots(fetchMap) {
217
+ var _this4 = this;
218
+ return Object.values(fetchMap).map(function (fetchStatus) {
219
+ return {
220
+ cacheId: fetchStatus.cacheId,
221
+ request: StateUtil.encodeValue(fetchStatus.request),
222
+ targets: fetchStatus.targets.map(function (_ref) {
223
+ var _entry$fetchMap;
224
+ var tmodel = _ref.tmodel,
225
+ targetName = _ref.targetName;
226
+ var key = _this4.getTModelKey(tmodel, targetName);
227
+ var entry = _this4.tmodelKeyMap[key];
228
+ var fetchEntry = entry === null || entry === void 0 || (_entry$fetchMap = entry.fetchMap) === null || _entry$fetchMap === void 0 ? void 0 : _entry$fetchMap[fetchStatus.fetchId];
229
+ return {
230
+ oid: tmodel.oid,
231
+ targetName: targetName,
232
+ order: fetchEntry === null || fetchEntry === void 0 ? void 0 : fetchEntry.order
233
+ };
234
+ }).filter(function (target) {
235
+ return Number.isFinite(target.order);
236
+ })
237
+ };
238
+ });
239
+ }
185
240
  }, {
186
241
  key: "removeFromTModelKeyMap",
187
242
  value: function removeFromTModelKeyMap(tmodel, targetName) {
@@ -291,7 +346,10 @@ var LoadingManager = /*#__PURE__*/function () {
291
346
  }, {
292
347
  key: "handleSuccess",
293
348
  value: function handleSuccess(fetchStatus, result) {
294
- var _this4 = this;
349
+ var _this5 = this;
350
+ if (fetchStatus.epoch !== this.runtimeEpoch) {
351
+ return;
352
+ }
295
353
  var fetchTime = TUtil.now();
296
354
  var fetchId = fetchStatus.fetchId,
297
355
  cacheId = fetchStatus.cacheId,
@@ -303,17 +361,17 @@ var LoadingManager = /*#__PURE__*/function () {
303
361
  success: true,
304
362
  result: result
305
363
  };
306
- targets.forEach(function (_ref) {
307
- var tmodel = _ref.tmodel,
308
- targetName = _ref.targetName;
309
- var key = _this4.getTModelKey(tmodel, targetName);
310
- var tmodelEntry = _this4.tmodelKeyMap[key];
364
+ targets.forEach(function (_ref2) {
365
+ var tmodel = _ref2.tmodel,
366
+ targetName = _ref2.targetName;
367
+ var key = _this5.getTModelKey(tmodel, targetName);
368
+ var tmodelEntry = _this5.tmodelKeyMap[key];
311
369
  var loadTargetName = TUtil.getLoadTargetName(targetName);
312
370
  if (!tmodelEntry || !tmodelEntry.fetchMap[fetchId]) {
313
371
  return;
314
372
  }
315
373
  var fetchEntry = tmodelEntry.fetchMap[fetchId];
316
- _this4.callOnSuccessHandler(tmodel, targetName, _objectSpread(_objectSpread({}, res), {}, {
374
+ _this5.callOnSuccessHandler(tmodel, targetName, _objectSpread(_objectSpread({}, res), {}, {
317
375
  order: fetchEntry.order
318
376
  }));
319
377
  var targetResults = tmodel.val(loadTargetName);
@@ -324,7 +382,7 @@ var LoadingManager = /*#__PURE__*/function () {
324
382
  targetResults[fetchEntry.order] = res.result;
325
383
  }
326
384
  tmodel.val(targetName, res.result);
327
- var newStatus = _this4.calculateTargetStatus(tmodel, targetName);
385
+ var newStatus = _this5.calculateTargetStatus(tmodel, targetName);
328
386
  tmodel.setTargetStatus(targetName, newStatus);
329
387
  tmodel.setLastUpdate(targetName);
330
388
  TargetUtil.shouldActivateNextTarget(tmodel, targetName);
@@ -338,18 +396,21 @@ var LoadingManager = /*#__PURE__*/function () {
338
396
  }, {
339
397
  key: "handleError",
340
398
  value: function handleError(fetchStatus, error) {
341
- var _this5 = this;
399
+ var _this6 = this;
400
+ if (fetchStatus.epoch !== this.runtimeEpoch) {
401
+ return;
402
+ }
342
403
  var fetchTime = TUtil.now();
343
404
  var fetchId = fetchStatus.fetchId,
344
405
  cacheId = fetchStatus.cacheId,
345
406
  startTime = fetchStatus.startTime,
346
407
  targets = fetchStatus.targets,
347
408
  fetchMap = fetchStatus.fetchMap;
348
- targets.forEach(function (_ref2) {
349
- var tmodel = _ref2.tmodel,
350
- targetName = _ref2.targetName;
351
- var key = _this5.getTModelKey(tmodel, targetName);
352
- var tmodelEntry = _this5.tmodelKeyMap[key];
409
+ targets.forEach(function (_ref3) {
410
+ var tmodel = _ref3.tmodel,
411
+ targetName = _ref3.targetName;
412
+ var key = _this6.getTModelKey(tmodel, targetName);
413
+ var tmodelEntry = _this6.tmodelKeyMap[key];
353
414
  var loadTargetName = TUtil.getLoadTargetName(targetName);
354
415
  if (!tmodelEntry || !tmodelEntry.fetchMap[fetchId]) {
355
416
  return;
@@ -370,8 +431,8 @@ var LoadingManager = /*#__PURE__*/function () {
370
431
  }
371
432
  tmodel.val(targetName, res);
372
433
  tmodelEntry.errorCount++;
373
- _this5.callOnErrorHandler(tmodel, targetName);
374
- var newStatus = _this5.calculateTargetStatus(tmodel, targetName);
434
+ _this6.callOnErrorHandler(tmodel, targetName);
435
+ var newStatus = _this6.calculateTargetStatus(tmodel, targetName);
375
436
  tmodel.setTargetStatus(targetName, newStatus);
376
437
  tmodel.setLastUpdate(targetName);
377
438
  TargetUtil.shouldActivateNextTarget(tmodel, targetName);
@@ -421,8 +482,8 @@ var LoadingManager = /*#__PURE__*/function () {
421
482
  }, {
422
483
  key: "ajaxAPI",
423
484
  value: function ajaxAPI(url, query, fetchStatus) {
424
- var _this6 = this,
425
- _ref3,
485
+ var _this7 = this,
486
+ _ref4,
426
487
  _opts$method,
427
488
  _opts$dataType;
428
489
  var defaults = {
@@ -430,10 +491,10 @@ var LoadingManager = /*#__PURE__*/function () {
430
491
  dataType: "json",
431
492
  type: "GET",
432
493
  success: function success(dataList) {
433
- return _this6.handleSuccess(fetchStatus, dataList);
494
+ return _this7.handleSuccess(fetchStatus, dataList);
434
495
  },
435
496
  error: function error(textStatus) {
436
- return _this6.handleError(fetchStatus, textStatus);
497
+ return _this7.handleError(fetchStatus, textStatus);
437
498
  }
438
499
  };
439
500
  var isPlainObj = function isPlainObj(q) {
@@ -463,7 +524,7 @@ var LoadingManager = /*#__PURE__*/function () {
463
524
  }
464
525
  }
465
526
  var final = _objectSpread(_objectSpread(_objectSpread({}, defaults), opts), {}, {
466
- type: (_ref3 = (_opts$method = opts.method) !== null && _opts$method !== void 0 ? _opts$method : opts.type) !== null && _ref3 !== void 0 ? _ref3 : defaults.type,
527
+ type: (_ref4 = (_opts$method = opts.method) !== null && _opts$method !== void 0 ? _opts$method : opts.type) !== null && _ref4 !== void 0 ? _ref4 : defaults.type,
467
528
  dataType: (_opts$dataType = opts.dataType) !== null && _opts$dataType !== void 0 ? _opts$dataType : defaults.dataType
468
529
  });
469
530
  if (!("data" in final) && Object.keys(dataBag).length) {
@@ -474,7 +535,7 @@ var LoadingManager = /*#__PURE__*/function () {
474
535
  }, {
475
536
  key: "loadImage",
476
537
  value: function loadImage(src, fetchStatus) {
477
- var _this7 = this;
538
+ var _this8 = this;
478
539
  var image = new Image();
479
540
  image.src = src;
480
541
  image.onload = function () {
@@ -483,11 +544,153 @@ var LoadingManager = /*#__PURE__*/function () {
483
544
  height: image.height,
484
545
  src: image.src
485
546
  };
486
- _this7.handleSuccess(fetchStatus, result);
547
+ _this8.handleSuccess(fetchStatus, result);
487
548
  };
488
549
  image.onerror = function () {
489
- _this7.handleError(fetchStatus, "not found");
550
+ _this8.handleError(fetchStatus, "not found");
551
+ };
552
+ }
553
+ }, {
554
+ key: "createRuntimeSnapshot",
555
+ value: function createRuntimeSnapshot() {
556
+ return {
557
+ cacheMap: StateUtil.encodeValue(this.cacheMap),
558
+ entries: Object.values(this.tmodelKeyMap).map(function (entry) {
559
+ return {
560
+ pageKey: entry.pageKey,
561
+ oid: entry.oid,
562
+ targetName: entry.targetName,
563
+ entryCount: entry.entryCount,
564
+ resultCount: entry.resultCount,
565
+ errorCount: entry.errorCount,
566
+ activeIndex: entry.activeIndex,
567
+ accessIndex: entry.accessIndex
568
+ };
569
+ }),
570
+ pendingRequests: [].concat(_toConsumableArray(this.getPendingRequestSnapshots(this.fetchingAPIMap)), _toConsumableArray(this.getPendingRequestSnapshots(this.fetchingImageMap)))
571
+ };
572
+ }
573
+ }, {
574
+ key: "restorePendingRequest",
575
+ value: function restorePendingRequest(savedRequest, tmodelIdMap) {
576
+ var request = StateUtil.decodeValue(savedRequest.request, tmodelIdMap);
577
+ var targets = [];
578
+ var _iterator = _createForOfIteratorHelper(savedRequest.targets || []),
579
+ _step;
580
+ try {
581
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
582
+ var savedTarget = _step.value;
583
+ var _tmodel = tmodelIdMap[savedTarget.oid];
584
+ if (!_tmodel) {
585
+ continue;
586
+ }
587
+ var _key = this.getTModelKey(_tmodel, savedTarget.targetName);
588
+ var _modelEntry = this.tmodelKeyMap[_key];
589
+ if (!_modelEntry) {
590
+ continue;
591
+ }
592
+ targets.push({
593
+ tmodel: _tmodel,
594
+ targetName: savedTarget.targetName,
595
+ order: savedTarget.order
596
+ });
597
+ }
598
+ } catch (err) {
599
+ _iterator.e(err);
600
+ } finally {
601
+ _iterator.f();
602
+ }
603
+ if (!targets.length) {
604
+ return;
605
+ }
606
+ var fetchId = "restored_".concat(++this.fetchSeq);
607
+ var fetchMap = request.type === "image" ? this.fetchingImageMap : this.fetchingAPIMap;
608
+ var fetchStatus = {
609
+ fetchId: fetchId,
610
+ cacheId: savedRequest.cacheId,
611
+ request: request,
612
+ startTime: TUtil.now(),
613
+ epoch: this.runtimeEpoch,
614
+ targets: targets.map(function (_ref5) {
615
+ var tmodel = _ref5.tmodel,
616
+ targetName = _ref5.targetName;
617
+ return {
618
+ tmodel: tmodel,
619
+ targetName: targetName
620
+ };
621
+ }),
622
+ fetchMap: fetchMap
490
623
  };
624
+ fetchMap[fetchId] = fetchStatus;
625
+ for (var _i2 = 0, _targets = targets; _i2 < _targets.length; _i2++) {
626
+ var _targets$_i = _targets[_i2],
627
+ tmodel = _targets$_i.tmodel,
628
+ targetName = _targets$_i.targetName,
629
+ order = _targets$_i.order;
630
+ var key = this.getTModelKey(tmodel, targetName);
631
+ var modelEntry = this.tmodelKeyMap[key];
632
+ modelEntry.fetchMap[fetchId] = {
633
+ fetchId: fetchId,
634
+ order: order
635
+ };
636
+ }
637
+ if (savedRequest.cacheId && this.isFetched(savedRequest.cacheId)) {
638
+ this.handleSuccess(fetchStatus, this.cacheMap[savedRequest.cacheId].result);
639
+ return;
640
+ }
641
+ if (request.type === "image") {
642
+ this.loadImage(request.src, fetchStatus);
643
+ } else {
644
+ this.ajaxAPI(request.url, request.query, fetchStatus);
645
+ }
646
+ }
647
+ }, {
648
+ key: "restoreRuntimeSnapshot",
649
+ value: function restoreRuntimeSnapshot(snapshot, tmodelIdMap) {
650
+ this.clear();
651
+ this.cacheMap = StateUtil.decodeValue((snapshot === null || snapshot === void 0 ? void 0 : snapshot.cacheMap) || {}, tmodelIdMap);
652
+ this.tmodelKeyMap = {};
653
+ this.targetPageKeyMap = new WeakMap();
654
+ var _iterator2 = _createForOfIteratorHelper((snapshot === null || snapshot === void 0 ? void 0 : snapshot.entries) || []),
655
+ _step2;
656
+ try {
657
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
658
+ var savedEntry = _step2.value;
659
+ var tmodel = tmodelIdMap[savedEntry.oid];
660
+ if (!tmodel) {
661
+ continue;
662
+ }
663
+ this.setTargetPageKey(tmodel, savedEntry.targetName, savedEntry.pageKey);
664
+ var key = this.getTModelKey(tmodel, savedEntry.targetName);
665
+ this.tmodelKeyMap[key] = {
666
+ pageKey: savedEntry.pageKey,
667
+ oid: savedEntry.oid,
668
+ targetName: savedEntry.targetName,
669
+ fetchMap: {},
670
+ entryCount: savedEntry.entryCount,
671
+ resultCount: savedEntry.resultCount,
672
+ errorCount: savedEntry.errorCount,
673
+ activeIndex: savedEntry.activeIndex,
674
+ accessIndex: savedEntry.accessIndex
675
+ };
676
+ }
677
+ } catch (err) {
678
+ _iterator2.e(err);
679
+ } finally {
680
+ _iterator2.f();
681
+ }
682
+ var _iterator3 = _createForOfIteratorHelper((snapshot === null || snapshot === void 0 ? void 0 : snapshot.pendingRequests) || []),
683
+ _step3;
684
+ try {
685
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
686
+ var pendingRequest = _step3.value;
687
+ this.restorePendingRequest(pendingRequest, tmodelIdMap);
688
+ }
689
+ } catch (err) {
690
+ _iterator3.e(err);
691
+ } finally {
692
+ _iterator3.f();
693
+ }
491
694
  }
492
695
  }]);
493
696
  }();