@loaders.gl/tiles 4.1.2 → 4.1.4

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.
Files changed (2) hide show
  1. package/dist/dist.dev.js +10 -5
  2. package/package.json +4 -4
package/dist/dist.dev.js CHANGED
@@ -4950,13 +4950,14 @@ var __exports__ = (() => {
4950
4950
  var DEFAULT_PROPS = {
4951
4951
  id: "request-scheduler",
4952
4952
  throttleRequests: true,
4953
- maxRequests: 6
4953
+ maxRequests: 6,
4954
+ debounceTime: 0
4954
4955
  };
4955
4956
  var RequestScheduler = class {
4956
4957
  activeRequestCount = 0;
4957
4958
  requestQueue = [];
4958
4959
  requestMap = /* @__PURE__ */ new Map();
4959
- deferredUpdate = null;
4960
+ updateTimer = null;
4960
4961
  constructor(props = {}) {
4961
4962
  this.props = {
4962
4963
  ...DEFAULT_PROPS,
@@ -5017,12 +5018,16 @@ var __exports__ = (() => {
5017
5018
  });
5018
5019
  }
5019
5020
  _issueNewRequests() {
5020
- if (!this.deferredUpdate) {
5021
- this.deferredUpdate = setTimeout(() => this._issueNewRequestsAsync(), 0);
5021
+ if (this.updateTimer !== null) {
5022
+ clearTimeout(this.updateTimer);
5022
5023
  }
5024
+ this.updateTimer = setTimeout(() => this._issueNewRequestsAsync(), this.props.debounceTime);
5023
5025
  }
5024
5026
  _issueNewRequestsAsync() {
5025
- this.deferredUpdate = null;
5027
+ if (this.updateTimer !== null) {
5028
+ clearTimeout(this.updateTimer);
5029
+ }
5030
+ this.updateTimer = null;
5026
5031
  const freeSlots = Math.max(this.props.maxRequests - this.activeRequestCount, 0);
5027
5032
  if (freeSlots === 0) {
5028
5033
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/tiles",
3
- "version": "4.1.2",
3
+ "version": "4.1.4",
4
4
  "description": "Common components for different tiles loaders.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -41,8 +41,8 @@
41
41
  "build-bundle": "ocular-bundle ./src/index.ts"
42
42
  },
43
43
  "dependencies": {
44
- "@loaders.gl/loader-utils": "4.1.2",
45
- "@loaders.gl/math": "4.1.2",
44
+ "@loaders.gl/loader-utils": "4.1.4",
45
+ "@loaders.gl/math": "4.1.4",
46
46
  "@math.gl/core": "^4.0.0",
47
47
  "@math.gl/culling": "^4.0.0",
48
48
  "@math.gl/geospatial": "^4.0.0",
@@ -55,5 +55,5 @@
55
55
  "devDependencies": {
56
56
  "@deck.gl/core": "^8.9.0"
57
57
  },
58
- "gitHead": "ade6b732407c6db83e3ff166c09ef239028173cc"
58
+ "gitHead": "e5b4fe1845c1483addfc4c3d630f1617595efbae"
59
59
  }