tsdf 11.1.1 → 11.1.2

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/main.cjs CHANGED
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
18
18
  return to;
19
19
  };
20
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
25
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
26
  mod
23
27
  ));
@@ -103,7 +107,7 @@ function createFetchOrquestrator({
103
107
  const id = getAutoIncrementId();
104
108
  lastFetchIdStarted = id;
105
109
  lastFetchWasAborted = false;
106
- fetchs.a = { startTime, onEnd: [] };
110
+ fetchs.a = { startTime, onEnd: [], rtuOnEnd: null };
107
111
  const prevFetchStartTime = lastFetchStartTime;
108
112
  lastFetchStartTime = startTime;
109
113
  function shouldAbort() {
@@ -131,10 +135,14 @@ function createFetchOrquestrator({
131
135
  fetchs.b = null;
132
136
  }
133
137
  const onEnd = currentFetchs.a.onEnd;
138
+ const rtuOnEnd = currentFetchs.a.rtuOnEnd;
134
139
  currentFetchs.a = null;
135
140
  if (onEnd.length > 0) {
136
141
  onEnd.forEach((cb) => cb());
137
142
  }
143
+ if (rtuOnEnd) {
144
+ rtuOnEnd();
145
+ }
138
146
  flushScheduledFetch();
139
147
  return true;
140
148
  }
@@ -213,9 +221,9 @@ function createFetchOrquestrator({
213
221
  return true;
214
222
  }
215
223
  if (fetchs.a) {
216
- fetchs.a.onEnd.push(() => {
224
+ fetchs.a.rtuOnEnd = () => {
217
225
  addDelayedRTU(Date.now(), params);
218
- });
226
+ };
219
227
  return true;
220
228
  } else if (mutationIsInProgress) {
221
229
  onMutationEnd.push(() => {
@@ -919,6 +927,7 @@ function newTSDFCollectionStore({
919
927
  itemStateKey: "",
920
928
  isLoading: false
921
929
  },
930
+ // eslint-disable-next-line react-hooks/exhaustive-deps
922
931
  [item]
923
932
  );
924
933
  const [useModifyResult, emitIsLoadedEvt] = useEnsureIsLoaded(
package/dist/main.js CHANGED
@@ -69,7 +69,7 @@ function createFetchOrquestrator({
69
69
  const id = getAutoIncrementId();
70
70
  lastFetchIdStarted = id;
71
71
  lastFetchWasAborted = false;
72
- fetchs.a = { startTime, onEnd: [] };
72
+ fetchs.a = { startTime, onEnd: [], rtuOnEnd: null };
73
73
  const prevFetchStartTime = lastFetchStartTime;
74
74
  lastFetchStartTime = startTime;
75
75
  function shouldAbort() {
@@ -97,10 +97,14 @@ function createFetchOrquestrator({
97
97
  fetchs.b = null;
98
98
  }
99
99
  const onEnd = currentFetchs.a.onEnd;
100
+ const rtuOnEnd = currentFetchs.a.rtuOnEnd;
100
101
  currentFetchs.a = null;
101
102
  if (onEnd.length > 0) {
102
103
  onEnd.forEach((cb) => cb());
103
104
  }
105
+ if (rtuOnEnd) {
106
+ rtuOnEnd();
107
+ }
104
108
  flushScheduledFetch();
105
109
  return true;
106
110
  }
@@ -179,9 +183,9 @@ function createFetchOrquestrator({
179
183
  return true;
180
184
  }
181
185
  if (fetchs.a) {
182
- fetchs.a.onEnd.push(() => {
186
+ fetchs.a.rtuOnEnd = () => {
183
187
  addDelayedRTU(Date.now(), params);
184
- });
188
+ };
185
189
  return true;
186
190
  } else if (mutationIsInProgress) {
187
191
  onMutationEnd.push(() => {
@@ -885,6 +889,7 @@ function newTSDFCollectionStore({
885
889
  itemStateKey: "",
886
890
  isLoading: false
887
891
  },
892
+ // eslint-disable-next-line react-hooks/exhaustive-deps
888
893
  [item]
889
894
  );
890
895
  const [useModifyResult, emitIsLoadedEvt] = useEnsureIsLoaded(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tsdf",
3
- "version": "11.1.1",
3
+ "version": "11.1.2",
4
4
  "description": "A data fetching solution based on t-state",
5
5
  "license": "MIT",
6
6
  "author": "Lucas Santos",
@@ -58,16 +58,16 @@
58
58
  "react-dom": "^18.2.0",
59
59
  "tiny-glob": "^0.2.9",
60
60
  "tsm": "^2.3.0",
61
- "tsup": "^6.5.0",
62
- "typescript": "^4.9.4",
63
- "vite": "^4.0.4",
64
- "vitest": "^0.29.3"
61
+ "tsup": "^6.7.0",
62
+ "typescript": "^5.0.4",
63
+ "vite": "^4.2.1",
64
+ "vitest": "^0.30.1"
65
65
  },
66
66
  "dependencies": {
67
67
  "immer": "^9.0.17",
68
68
  "klona": "^2.0.6",
69
69
  "mitt": "^3.0.0",
70
- "t-state": "^8.0.0"
70
+ "t-state": "^8.3.0"
71
71
  },
72
72
  "peerDependencies": {
73
73
  "react": "^18.0.0",