@tanstack/query-devtools 5.104.0 → 5.104.1
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/build/{Devtools-xfqOl5Dl.js → Devtools-BR7-Ww0_.js} +159 -62
- package/build/Devtools-BTIH1dw_.js +1238 -0
- package/build/Devtools-BTIH1dw_.js.map +1 -0
- package/build/{Devtools-XuAvSfeN.cjs → Devtools-DDPb_OXS.cjs} +176 -61
- package/build/Devtools-DE6wfpC3.cjs +1237 -0
- package/build/DevtoolsComponent-B-JX7seJ.js +2 -0
- package/build/DevtoolsComponent-B-JX7seJ.js.map +1 -0
- package/build/DevtoolsComponent-DdJdz_3E.cjs +40 -0
- package/build/DevtoolsComponent-PDsMk_-d.js +40 -0
- package/build/DevtoolsComponent-u_hbjcma.cjs +1 -0
- package/build/DevtoolsPanelComponent-CdrNDWsc.js +2 -0
- package/build/DevtoolsPanelComponent-CdrNDWsc.js.map +1 -0
- package/build/DevtoolsPanelComponent-D7InkRel.cjs +47 -0
- package/build/DevtoolsPanelComponent-DWMNAgBe.js +47 -0
- package/build/DevtoolsPanelComponent-DyNlv9xD.cjs +1 -0
- package/build/dev.cjs +2 -2
- package/build/dev.js +2 -2
- package/build/index.cjs +1 -1
- package/build/index.d.cts +1 -0
- package/build/index.d.cts.map +1 -1
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -1
- package/package.json +8 -8
- package/src/Devtools.tsx +62 -82
- package/src/DevtoolsComponent.tsx +17 -5
- package/src/DevtoolsPanelComponent.tsx +23 -14
- package/src/contexts/DevtoolsOfflineContext.ts +10 -0
- package/src/contexts/DevtoolsStateContext.ts +10 -0
- package/src/contexts/DevtoolsSubscriptionsContext.ts +11 -0
- package/src/contexts/types.ts +37 -1
- package/src/createCacheSubscriptionRegistry.ts +40 -0
- package/src/providers/DevtoolsOfflineProvider.tsx +31 -0
- package/src/providers/DevtoolsStateProvider.tsx +28 -0
- package/src/providers/DevtoolsSubscriptionsProvider.tsx +30 -0
- package/build/Devtools-DP9QP4ya.cjs +0 -1237
- package/build/Devtools-DpIxfOum.js +0 -1238
- package/build/Devtools-DpIxfOum.js.map +0 -1
- package/build/DevtoolsComponent-BEFw32kp.js +0 -2
- package/build/DevtoolsComponent-BEFw32kp.js.map +0 -1
- package/build/DevtoolsComponent-DRjJuLRU.js +0 -34
- package/build/DevtoolsComponent-DjkCvfLf.cjs +0 -34
- package/build/DevtoolsComponent-bl_b_SFT.cjs +0 -1
- package/build/DevtoolsPanelComponent-BE6hbJd6.js +0 -2
- package/build/DevtoolsPanelComponent-BE6hbJd6.js.map +0 -1
- package/build/DevtoolsPanelComponent-BTfH8T_h.cjs +0 -41
- package/build/DevtoolsPanelComponent-CkmpODyJ.js +0 -41
- package/build/DevtoolsPanelComponent-DfaRC3RE.cjs +0 -1
|
@@ -232,6 +232,127 @@ var cookieStorage = addClearMethod({
|
|
|
232
232
|
}
|
|
233
233
|
});
|
|
234
234
|
//#endregion
|
|
235
|
+
//#region src/contexts/QueryDevtoolsContext.ts
|
|
236
|
+
const QueryDevtoolsContext = createContext({
|
|
237
|
+
client: void 0,
|
|
238
|
+
onlineManager: void 0,
|
|
239
|
+
queryFlavor: "",
|
|
240
|
+
version: "",
|
|
241
|
+
shadowDOMTarget: void 0
|
|
242
|
+
});
|
|
243
|
+
function useQueryDevtoolsContext() {
|
|
244
|
+
return useContext(QueryDevtoolsContext);
|
|
245
|
+
}
|
|
246
|
+
//#endregion
|
|
247
|
+
//#region src/contexts/DevtoolsOfflineContext.ts
|
|
248
|
+
const DevtoolsOfflineContext = createContext();
|
|
249
|
+
function useDevtoolsOffline() {
|
|
250
|
+
const state = useContext(DevtoolsOfflineContext);
|
|
251
|
+
if (!state) throw new Error("Missing DevtoolsOfflineProvider");
|
|
252
|
+
return state;
|
|
253
|
+
}
|
|
254
|
+
//#endregion
|
|
255
|
+
//#region src/providers/DevtoolsOfflineProvider.tsx
|
|
256
|
+
function DevtoolsOfflineProvider(props) {
|
|
257
|
+
const [offline, setOffline] = createSignal(false);
|
|
258
|
+
const context = useQueryDevtoolsContext();
|
|
259
|
+
createEffect(() => {
|
|
260
|
+
const manager = context.onlineManager;
|
|
261
|
+
setOffline(!manager.isOnline());
|
|
262
|
+
const unsubscribe = manager.subscribe((online) => setOffline(!online));
|
|
263
|
+
onCleanup(unsubscribe);
|
|
264
|
+
});
|
|
265
|
+
const state = {
|
|
266
|
+
offline,
|
|
267
|
+
toggleOffline: () => {
|
|
268
|
+
const manager = context.onlineManager;
|
|
269
|
+
manager.setOnline(!manager.isOnline());
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
return createComponent(DevtoolsOfflineContext.Provider, {
|
|
273
|
+
value: state,
|
|
274
|
+
get children() {
|
|
275
|
+
return props.children;
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
//#endregion
|
|
280
|
+
//#region src/createCacheSubscriptionRegistry.ts
|
|
281
|
+
function createCacheSubscriptionRegistry() {
|
|
282
|
+
const subscriptions = /* @__PURE__ */ new Map();
|
|
283
|
+
function register(callback, setter, shouldUpdate = () => true) {
|
|
284
|
+
const id = Symbol();
|
|
285
|
+
subscriptions.set(id, {
|
|
286
|
+
shouldUpdate,
|
|
287
|
+
update: (cache) => setter(callback(cache))
|
|
288
|
+
});
|
|
289
|
+
onCleanup(() => subscriptions.delete(id));
|
|
290
|
+
}
|
|
291
|
+
function notify(cache, event, schedule = (update) => update()) {
|
|
292
|
+
for (const [id, subscription] of subscriptions) {
|
|
293
|
+
if (!subscription.shouldUpdate(event)) continue;
|
|
294
|
+
schedule(() => {
|
|
295
|
+
if (subscriptions.has(id)) subscription.update(cache);
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
return {
|
|
300
|
+
register,
|
|
301
|
+
notify
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
//#endregion
|
|
305
|
+
//#region src/contexts/DevtoolsSubscriptionsContext.ts
|
|
306
|
+
const DevtoolsSubscriptionsContext = createContext();
|
|
307
|
+
function useDevtoolsSubscriptions() {
|
|
308
|
+
const subscriptions = useContext(DevtoolsSubscriptionsContext);
|
|
309
|
+
if (!subscriptions) throw new Error("Missing DevtoolsSubscriptionsProvider");
|
|
310
|
+
return subscriptions;
|
|
311
|
+
}
|
|
312
|
+
//#endregion
|
|
313
|
+
//#region src/providers/DevtoolsSubscriptionsProvider.tsx
|
|
314
|
+
function DevtoolsSubscriptionsProvider(props) {
|
|
315
|
+
const subscriptions = {
|
|
316
|
+
queryCacheSubscriptions: createCacheSubscriptionRegistry(),
|
|
317
|
+
mutationCacheSubscriptions: createCacheSubscriptionRegistry()
|
|
318
|
+
};
|
|
319
|
+
return createComponent(DevtoolsSubscriptionsContext.Provider, {
|
|
320
|
+
value: subscriptions,
|
|
321
|
+
get children() {
|
|
322
|
+
return props.children;
|
|
323
|
+
}
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
//#endregion
|
|
327
|
+
//#region src/contexts/DevtoolsStateContext.ts
|
|
328
|
+
const DevtoolsStateContext = createContext();
|
|
329
|
+
function useDevtoolsState() {
|
|
330
|
+
const state = useContext(DevtoolsStateContext);
|
|
331
|
+
if (!state) throw new Error("Missing DevtoolsStateProvider");
|
|
332
|
+
return state;
|
|
333
|
+
}
|
|
334
|
+
//#endregion
|
|
335
|
+
//#region src/providers/DevtoolsStateProvider.tsx
|
|
336
|
+
function DevtoolsStateProvider(props) {
|
|
337
|
+
const [selectedQueryHash, setSelectedQueryHash] = createSignal(null);
|
|
338
|
+
const [selectedMutationId, setSelectedMutationId] = createSignal(null);
|
|
339
|
+
const [panelWidth, setPanelWidth] = createSignal(0);
|
|
340
|
+
const state = {
|
|
341
|
+
selectedQueryHash,
|
|
342
|
+
setSelectedQueryHash,
|
|
343
|
+
selectedMutationId,
|
|
344
|
+
setSelectedMutationId,
|
|
345
|
+
panelWidth,
|
|
346
|
+
setPanelWidth
|
|
347
|
+
};
|
|
348
|
+
return createComponent(DevtoolsStateContext.Provider, {
|
|
349
|
+
value: state,
|
|
350
|
+
get children() {
|
|
351
|
+
return props.children;
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
//#endregion
|
|
235
356
|
//#region ../../node_modules/.pnpm/@tanstack+match-sorter-utils@9.1.2/node_modules/@tanstack/match-sorter-utils/dist/remove-accents.js
|
|
236
357
|
const characterMap = {
|
|
237
358
|
À: "A",
|
|
@@ -7661,18 +7782,6 @@ const THEME_PREFERENCE = "system";
|
|
|
7661
7782
|
const DEFAULT_SORT_FN_NAME = Object.keys(sortFns)[0];
|
|
7662
7783
|
const DEFAULT_MUTATION_SORT_FN_NAME = Object.keys(mutationSortFns)[0];
|
|
7663
7784
|
//#endregion
|
|
7664
|
-
//#region src/contexts/QueryDevtoolsContext.ts
|
|
7665
|
-
const QueryDevtoolsContext = createContext({
|
|
7666
|
-
client: void 0,
|
|
7667
|
-
onlineManager: void 0,
|
|
7668
|
-
queryFlavor: "",
|
|
7669
|
-
version: "",
|
|
7670
|
-
shadowDOMTarget: void 0
|
|
7671
|
-
});
|
|
7672
|
-
function useQueryDevtoolsContext() {
|
|
7673
|
-
return useContext(QueryDevtoolsContext);
|
|
7674
|
-
}
|
|
7675
|
-
//#endregion
|
|
7676
7785
|
//#region src/contexts/PiPContext.tsx
|
|
7677
7786
|
var PipOpenError = class extends Error {};
|
|
7678
7787
|
const PiPContext = createContext(void 0);
|
|
@@ -8490,25 +8599,12 @@ var _tmpl$35 = /*#__PURE__*/ template(`<form><textarea name=data aria-label="Edi
|
|
|
8490
8599
|
var _tmpl$36 = /*#__PURE__*/ template(`<div><div role=heading aria-level=2>Query Details</div><div><div class=tsqd-query-details-summary><pre><code></code></pre><span role=status aria-live=polite></span></div><div class=tsqd-query-details-observers-count><span>Observers:</span><span></span></div><div class=tsqd-query-details-last-updated><span>Last Updated:</span><span></span></div></div><div role=heading aria-level=2>Actions</div><div><button><span aria-hidden=true></span>Refetch</button><button><span aria-hidden=true></span>Invalidate</button><button><span aria-hidden=true></span>Reset</button><button><span aria-hidden=true></span>Remove</button><button><span aria-hidden=true></span> Loading</button></div><div role=heading aria-level=2>Data </div><div role=heading aria-level=2>Query Explorer</div><div class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer">`);
|
|
8491
8600
|
var _tmpl$37 = /*#__PURE__*/ template(`<option>`);
|
|
8492
8601
|
var _tmpl$38 = /*#__PURE__*/ template(`<div><div role=heading aria-level=2>Mutation Details</div><div><div class=tsqd-query-details-summary><pre><code></code></pre><span role=status aria-live=polite></span></div><div class=tsqd-query-details-last-updated><span>Submitted At:</span><span></span></div></div><div role=heading aria-level=2>Variables Details</div><div class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer"></div><div role=heading aria-level=2>Context Details</div><div class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer"></div><div role=heading aria-level=2>Data Explorer</div><div class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer"></div><div role=heading aria-level=2>Mutations Explorer</div><div class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer">`);
|
|
8493
|
-
const [selectedQueryHash, setSelectedQueryHash] = createSignal(null);
|
|
8494
|
-
const [selectedMutationId, setSelectedMutationId] = createSignal(null);
|
|
8495
|
-
const [panelWidth, setPanelWidth] = createSignal(0);
|
|
8496
|
-
const [offline, setOffline] = createSignal(false);
|
|
8497
8602
|
const Devtools = (props) => {
|
|
8498
8603
|
const theme = useTheme();
|
|
8499
8604
|
const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
|
|
8500
8605
|
const styles = createMemo(() => {
|
|
8501
8606
|
return theme() === "dark" ? darkStyles(css) : lightStyles(css);
|
|
8502
8607
|
});
|
|
8503
|
-
const onlineManager = createMemo(() => useQueryDevtoolsContext().onlineManager);
|
|
8504
|
-
onMount(() => {
|
|
8505
|
-
const unsubscribe = onlineManager().subscribe((online) => {
|
|
8506
|
-
setOffline(!online);
|
|
8507
|
-
});
|
|
8508
|
-
onCleanup(() => {
|
|
8509
|
-
unsubscribe();
|
|
8510
|
-
});
|
|
8511
|
-
});
|
|
8512
8608
|
const pip = usePiPWindow();
|
|
8513
8609
|
const buttonPosition = createMemo(() => {
|
|
8514
8610
|
return useQueryDevtoolsContext().buttonPosition || "bottom-right";
|
|
@@ -8630,6 +8726,7 @@ const Devtools = (props) => {
|
|
|
8630
8726
|
})()];
|
|
8631
8727
|
};
|
|
8632
8728
|
const PiPPanel = (props) => {
|
|
8729
|
+
const { panelWidth, setPanelWidth } = useDevtoolsState();
|
|
8633
8730
|
const pip = usePiPWindow();
|
|
8634
8731
|
const theme = useTheme();
|
|
8635
8732
|
const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
|
|
@@ -8672,6 +8769,7 @@ const PiPPanel = (props) => {
|
|
|
8672
8769
|
})();
|
|
8673
8770
|
};
|
|
8674
8771
|
const ParentPanel = (props) => {
|
|
8772
|
+
const { panelWidth, setPanelWidth } = useDevtoolsState();
|
|
8675
8773
|
const theme = useTheme();
|
|
8676
8774
|
const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
|
|
8677
8775
|
const styles = createMemo(() => {
|
|
@@ -8707,6 +8805,7 @@ const ParentPanel = (props) => {
|
|
|
8707
8805
|
})();
|
|
8708
8806
|
};
|
|
8709
8807
|
const DraggablePanel = (props) => {
|
|
8808
|
+
const { setSelectedQueryHash, panelWidth, setPanelWidth } = useDevtoolsState();
|
|
8710
8809
|
const theme = useTheme();
|
|
8711
8810
|
const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
|
|
8712
8811
|
const styles = createMemo(() => {
|
|
@@ -8850,6 +8949,8 @@ const DraggablePanel = (props) => {
|
|
|
8850
8949
|
})();
|
|
8851
8950
|
};
|
|
8852
8951
|
const ContentView = (props) => {
|
|
8952
|
+
const { selectedQueryHash, setSelectedQueryHash, selectedMutationId, setSelectedMutationId, panelWidth } = useDevtoolsState();
|
|
8953
|
+
const { offline, toggleOffline } = useDevtoolsOffline();
|
|
8853
8954
|
setupQueryCacheSubscription();
|
|
8854
8955
|
setupMutationCacheSubscription();
|
|
8855
8956
|
let containerRef;
|
|
@@ -8866,7 +8967,6 @@ const ContentView = (props) => {
|
|
|
8866
8967
|
const mutationSortOrder = createMemo(() => Number(props.localStore.mutationSortOrder) || 1);
|
|
8867
8968
|
const sortFn = createMemo(() => sortFns[sort()]);
|
|
8868
8969
|
const mutationSortFn = createMemo(() => mutationSortFns[mutationSort()]);
|
|
8869
|
-
const onlineManager = createMemo(() => useQueryDevtoolsContext().onlineManager);
|
|
8870
8970
|
const query_cache = createMemo(() => {
|
|
8871
8971
|
return useQueryDevtoolsContext().client.getQueryCache();
|
|
8872
8972
|
});
|
|
@@ -9063,9 +9163,7 @@ const ContentView = (props) => {
|
|
|
9063
9163
|
}
|
|
9064
9164
|
};
|
|
9065
9165
|
insert(_el$26, createComponent(Trash, {}));
|
|
9066
|
-
_el$27
|
|
9067
|
-
onlineManager().setOnline(!onlineManager().isOnline());
|
|
9068
|
-
};
|
|
9166
|
+
addEventListener(_el$27, "click", toggleOffline, true);
|
|
9069
9167
|
insert(_el$27, (() => {
|
|
9070
9168
|
var _c$ = memo(() => !!offline());
|
|
9071
9169
|
return () => _c$() ? createComponent(Offline, {}) : createComponent(Wifi, {});
|
|
@@ -9452,6 +9550,7 @@ const ContentView = (props) => {
|
|
|
9452
9550
|
];
|
|
9453
9551
|
};
|
|
9454
9552
|
const QueryRow = (props) => {
|
|
9553
|
+
const { selectedQueryHash, setSelectedQueryHash } = useDevtoolsState();
|
|
9455
9554
|
const theme = useTheme();
|
|
9456
9555
|
const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
|
|
9457
9556
|
const styles = createMemo(() => {
|
|
@@ -9520,6 +9619,7 @@ const QueryRow = (props) => {
|
|
|
9520
9619
|
});
|
|
9521
9620
|
};
|
|
9522
9621
|
const MutationRow = (props) => {
|
|
9622
|
+
const { selectedMutationId, setSelectedMutationId } = useDevtoolsState();
|
|
9523
9623
|
const theme = useTheme();
|
|
9524
9624
|
const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
|
|
9525
9625
|
const styles = createMemo(() => {
|
|
@@ -9732,6 +9832,7 @@ const MutationStatusCount = () => {
|
|
|
9732
9832
|
})();
|
|
9733
9833
|
};
|
|
9734
9834
|
const QueryStatus = (props) => {
|
|
9835
|
+
const { selectedQueryHash, panelWidth } = useDevtoolsState();
|
|
9735
9836
|
const theme = useTheme();
|
|
9736
9837
|
const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
|
|
9737
9838
|
const styles = createMemo(() => {
|
|
@@ -9820,6 +9921,7 @@ const QueryStatus = (props) => {
|
|
|
9820
9921
|
})();
|
|
9821
9922
|
};
|
|
9822
9923
|
const QueryDetails = () => {
|
|
9924
|
+
const { selectedQueryHash, setSelectedQueryHash } = useDevtoolsState();
|
|
9823
9925
|
const theme = useTheme();
|
|
9824
9926
|
const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
|
|
9825
9927
|
const styles = createMemo(() => {
|
|
@@ -10221,6 +10323,7 @@ const QueryDetails = () => {
|
|
|
10221
10323
|
});
|
|
10222
10324
|
};
|
|
10223
10325
|
const MutationDetails = () => {
|
|
10326
|
+
const { selectedMutationId } = useDevtoolsState();
|
|
10224
10327
|
const theme = useTheme();
|
|
10225
10328
|
const css = useQueryDevtoolsContext().shadowDOMTarget ? u.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) : u;
|
|
10226
10329
|
const styles = createMemo(() => {
|
|
@@ -10346,26 +10449,23 @@ const MutationDetails = () => {
|
|
|
10346
10449
|
}
|
|
10347
10450
|
});
|
|
10348
10451
|
};
|
|
10349
|
-
const queryCacheMap = /* @__PURE__ */ new Map();
|
|
10350
10452
|
const setupQueryCacheSubscription = () => {
|
|
10453
|
+
const { queryCacheSubscriptions } = useDevtoolsSubscriptions();
|
|
10351
10454
|
const queryCache = createMemo(() => {
|
|
10352
10455
|
return useQueryDevtoolsContext().client.getQueryCache();
|
|
10353
10456
|
});
|
|
10354
|
-
|
|
10355
|
-
|
|
10356
|
-
|
|
10357
|
-
|
|
10358
|
-
|
|
10359
|
-
}
|
|
10457
|
+
createEffect(() => {
|
|
10458
|
+
const cache = queryCache();
|
|
10459
|
+
const unsubscribe = cache.subscribe((event) => {
|
|
10460
|
+
batch(() => {
|
|
10461
|
+
queryCacheSubscriptions.notify(() => cache, event);
|
|
10462
|
+
});
|
|
10360
10463
|
});
|
|
10464
|
+
onCleanup(unsubscribe);
|
|
10361
10465
|
});
|
|
10362
|
-
onCleanup(() => {
|
|
10363
|
-
queryCacheMap.clear();
|
|
10364
|
-
unsubscribe();
|
|
10365
|
-
});
|
|
10366
|
-
return unsubscribe;
|
|
10367
10466
|
};
|
|
10368
10467
|
const createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true, shouldUpdate = () => true) => {
|
|
10468
|
+
const { queryCacheSubscriptions } = useDevtoolsSubscriptions();
|
|
10369
10469
|
const queryCache = createMemo(() => {
|
|
10370
10470
|
return useQueryDevtoolsContext().client.getQueryCache();
|
|
10371
10471
|
});
|
|
@@ -10373,32 +10473,32 @@ const createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true, shou
|
|
|
10373
10473
|
createEffect(() => {
|
|
10374
10474
|
setValue(callback(queryCache));
|
|
10375
10475
|
});
|
|
10376
|
-
|
|
10377
|
-
setter: setValue,
|
|
10378
|
-
shouldUpdate
|
|
10379
|
-
});
|
|
10380
|
-
onCleanup(() => {
|
|
10381
|
-
queryCacheMap.delete(callback);
|
|
10382
|
-
});
|
|
10476
|
+
queryCacheSubscriptions.register(callback, setValue, shouldUpdate);
|
|
10383
10477
|
return value;
|
|
10384
10478
|
};
|
|
10385
|
-
const mutationCacheMap = /* @__PURE__ */ new Map();
|
|
10386
10479
|
const setupMutationCacheSubscription = () => {
|
|
10480
|
+
const { mutationCacheSubscriptions } = useDevtoolsSubscriptions();
|
|
10387
10481
|
const mutationCache = createMemo(() => {
|
|
10388
10482
|
return useQueryDevtoolsContext().client.getMutationCache();
|
|
10389
10483
|
});
|
|
10390
|
-
|
|
10391
|
-
|
|
10392
|
-
|
|
10484
|
+
createEffect(() => {
|
|
10485
|
+
const cache = mutationCache();
|
|
10486
|
+
let active = true;
|
|
10487
|
+
const unsubscribe = cache.subscribe((event) => {
|
|
10488
|
+
mutationCacheSubscriptions.notify(() => cache, event, (update) => {
|
|
10489
|
+
queueMicrotask(() => {
|
|
10490
|
+
if (active) update();
|
|
10491
|
+
});
|
|
10492
|
+
});
|
|
10493
|
+
});
|
|
10494
|
+
onCleanup(() => {
|
|
10495
|
+
active = false;
|
|
10496
|
+
unsubscribe();
|
|
10393
10497
|
});
|
|
10394
10498
|
});
|
|
10395
|
-
onCleanup(() => {
|
|
10396
|
-
mutationCacheMap.clear();
|
|
10397
|
-
unsubscribe();
|
|
10398
|
-
});
|
|
10399
|
-
return unsubscribe;
|
|
10400
10499
|
};
|
|
10401
10500
|
const createSubscribeToMutationCacheBatcher = (callback, equalityCheck = true) => {
|
|
10501
|
+
const { mutationCacheSubscriptions } = useDevtoolsSubscriptions();
|
|
10402
10502
|
const mutationCache = createMemo(() => {
|
|
10403
10503
|
return useQueryDevtoolsContext().client.getMutationCache();
|
|
10404
10504
|
});
|
|
@@ -10406,10 +10506,7 @@ const createSubscribeToMutationCacheBatcher = (callback, equalityCheck = true) =
|
|
|
10406
10506
|
createEffect(() => {
|
|
10407
10507
|
setValue(callback(mutationCache));
|
|
10408
10508
|
});
|
|
10409
|
-
|
|
10410
|
-
onCleanup(() => {
|
|
10411
|
-
mutationCacheMap.delete(callback);
|
|
10412
|
-
});
|
|
10509
|
+
mutationCacheSubscriptions.register(callback, setValue);
|
|
10413
10510
|
return value;
|
|
10414
10511
|
};
|
|
10415
10512
|
const DEV_TOOLS_EVENT = "@tanstack/query-devtools-event";
|
|
@@ -11480,4 +11577,4 @@ delegateEvents([
|
|
|
11480
11577
|
"input"
|
|
11481
11578
|
]);
|
|
11482
11579
|
//#endregion
|
|
11483
|
-
export { PiPProvider as a,
|
|
11580
|
+
export { PiPProvider as a, DevtoolsSubscriptionsProvider as c, createLocalStorage as d, ThemeContext as i, DevtoolsOfflineProvider as l, Devtools as n, THEME_PREFERENCE as o, ParentPanel as r, DevtoolsStateProvider as s, ContentView as t, QueryDevtoolsContext as u };
|