@tanstack/react-query-devtools 4.0.5 → 4.0.6
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/cjs/packages/react-query-devtools/src/devtools.js +3 -16
- package/build/cjs/packages/react-query-devtools/src/devtools.js.map +1 -1
- package/build/cjs/packages/react-query-devtools/src/index.js +8 -4
- package/build/cjs/packages/react-query-devtools/src/index.js.map +1 -1
- package/build/cjs/packages/react-query-devtools/src/utils.js +13 -0
- package/build/cjs/packages/react-query-devtools/src/utils.js.map +1 -1
- package/build/esm/index.js +23 -16
- package/build/esm/index.js.map +1 -1
- package/build/esm/noop.js +7 -0
- package/build/stats-html.html +1 -1
- package/build/stats.json +156 -281
- package/build/types/react-query-devtools/src/__tests__/utils.d.ts +1 -1
- package/build/types/react-query-devtools/src/devtools.d.ts +2 -3
- package/build/types/react-query-devtools/src/index.d.ts +3 -1
- package/build/types/react-query-devtools/src/utils.d.ts +1 -0
- package/build/umd/index.development.js +18 -16
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -18
- package/build/umd/index.production.js.map +1 -1
- package/package.json +7 -1
- package/src/__tests__/devtools.test.tsx +1 -1
- package/src/__tests__/utils.tsx +1 -1
- package/src/devtools.tsx +2 -24
- package/src/index.ts +15 -1
- package/src/utils.ts +21 -0
|
@@ -943,6 +943,18 @@
|
|
|
943
943
|
return JSON.stringify(newValue, name);
|
|
944
944
|
};
|
|
945
945
|
|
|
946
|
+
const getStatusRank = q => q.state.fetchStatus !== 'idle' ? 0 : !q.getObserversCount() ? 3 : q.isStale() ? 2 : 1;
|
|
947
|
+
|
|
948
|
+
const sortFns = {
|
|
949
|
+
'Status > Last Updated': (a, b) => {
|
|
950
|
+
var _sortFns$LastUpdated;
|
|
951
|
+
|
|
952
|
+
return getStatusRank(a) === getStatusRank(b) ? (_sortFns$LastUpdated = sortFns['Last Updated']) == null ? void 0 : _sortFns$LastUpdated.call(sortFns, a, b) : getStatusRank(a) > getStatusRank(b) ? 1 : -1;
|
|
953
|
+
},
|
|
954
|
+
'Query Hash': (a, b) => a.queryHash > b.queryHash ? 1 : -1,
|
|
955
|
+
'Last Updated': (a, b) => a.state.dataUpdatedAt < b.state.dataUpdatedAt ? 1 : -1
|
|
956
|
+
};
|
|
957
|
+
|
|
946
958
|
const Panel = styled('div', (_props, theme) => ({
|
|
947
959
|
fontSize: 'clamp(12px, 1.5vw, 14px)',
|
|
948
960
|
fontFamily: "sans-serif",
|
|
@@ -1224,7 +1236,7 @@
|
|
|
1224
1236
|
}
|
|
1225
1237
|
|
|
1226
1238
|
const isServer = typeof window === 'undefined';
|
|
1227
|
-
function ReactQueryDevtools({
|
|
1239
|
+
function ReactQueryDevtools$1({
|
|
1228
1240
|
initialIsOpen,
|
|
1229
1241
|
panelProps = {},
|
|
1230
1242
|
closeButtonProps = {},
|
|
@@ -1358,7 +1370,7 @@
|
|
|
1358
1370
|
"aria-label": "React Query Devtools"
|
|
1359
1371
|
}, /*#__PURE__*/React__namespace.createElement(ThemeProvider, {
|
|
1360
1372
|
theme: defaultTheme
|
|
1361
|
-
}, /*#__PURE__*/React__namespace.createElement(ReactQueryDevtoolsPanel, _extends({
|
|
1373
|
+
}, /*#__PURE__*/React__namespace.createElement(ReactQueryDevtoolsPanel$1, _extends({
|
|
1362
1374
|
ref: panelRef,
|
|
1363
1375
|
context: context,
|
|
1364
1376
|
styleNonce: styleNonce
|
|
@@ -1463,23 +1475,11 @@
|
|
|
1463
1475
|
})) : null);
|
|
1464
1476
|
}
|
|
1465
1477
|
|
|
1466
|
-
const getStatusRank = q => q.state.fetchStatus !== 'idle' ? 0 : !q.getObserversCount() ? 3 : q.isStale() ? 2 : 1;
|
|
1467
|
-
|
|
1468
|
-
const sortFns = {
|
|
1469
|
-
'Status > Last Updated': (a, b) => {
|
|
1470
|
-
var _sortFns$LastUpdated;
|
|
1471
|
-
|
|
1472
|
-
return getStatusRank(a) === getStatusRank(b) ? (_sortFns$LastUpdated = sortFns['Last Updated']) == null ? void 0 : _sortFns$LastUpdated.call(sortFns, a, b) : getStatusRank(a) > getStatusRank(b) ? 1 : -1;
|
|
1473
|
-
},
|
|
1474
|
-
'Query Hash': (a, b) => a.queryHash > b.queryHash ? 1 : -1,
|
|
1475
|
-
'Last Updated': (a, b) => a.state.dataUpdatedAt < b.state.dataUpdatedAt ? 1 : -1
|
|
1476
|
-
};
|
|
1477
|
-
|
|
1478
1478
|
const useSubscribeToQueryCache = (queryCache, getSnapshot) => {
|
|
1479
1479
|
return shim.useSyncExternalStore(React__namespace.useCallback(onStoreChange => queryCache.subscribe(reactQuery.notifyManager.batchCalls(onStoreChange)), [queryCache]), getSnapshot, getSnapshot);
|
|
1480
1480
|
};
|
|
1481
1481
|
|
|
1482
|
-
const ReactQueryDevtoolsPanel = /*#__PURE__*/React__namespace.forwardRef(function ReactQueryDevtoolsPanel(props, ref) {
|
|
1482
|
+
const ReactQueryDevtoolsPanel$1 = /*#__PURE__*/React__namespace.forwardRef(function ReactQueryDevtoolsPanel(props, ref) {
|
|
1483
1483
|
const {
|
|
1484
1484
|
isOpen = true,
|
|
1485
1485
|
styleNonce,
|
|
@@ -1991,9 +1991,11 @@
|
|
|
1991
1991
|
|
|
1992
1992
|
function noop() {}
|
|
1993
1993
|
|
|
1994
|
+
const ReactQueryDevtools = ReactQueryDevtools$1;
|
|
1995
|
+
const ReactQueryDevtoolsPanel = ReactQueryDevtoolsPanel$1;
|
|
1996
|
+
|
|
1994
1997
|
exports.ReactQueryDevtools = ReactQueryDevtools;
|
|
1995
1998
|
exports.ReactQueryDevtoolsPanel = ReactQueryDevtoolsPanel;
|
|
1996
|
-
exports.sortFns = sortFns;
|
|
1997
1999
|
|
|
1998
2000
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
1999
2001
|
|