@tanstack/react-query-devtools 4.13.5 → 4.13.7

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.
@@ -192,13 +192,14 @@ function useIsMounted() {
192
192
  /**
193
193
  * Displays a string regardless the type of the data
194
194
  * @param {unknown} value Value to be stringified
195
+ * @param {boolean} beautify Formats json to multiline
195
196
  */
196
197
 
197
- const displayValue = value => {
198
+ const displayValue = (value, beautify = false) => {
198
199
  const {
199
200
  json
200
201
  } = SuperJSON__default["default"].serialize(value);
201
- return JSON.stringify(json);
202
+ return JSON.stringify(json, null, beautify ? 2 : undefined);
202
203
  }; // Sorting functions
203
204
 
204
205
  const getStatusRank = q => q.state.fetchStatus !== 'idle' ? 0 : !q.getObserversCount() ? 3 : q.isStale() ? 2 : 1;
@@ -1161,7 +1162,7 @@ const ActiveQuery = ({
1161
1162
  padding: 0,
1162
1163
  overflow: 'auto'
1163
1164
  }
1164
- }, JSON.stringify(activeQuery.queryKey, null, 2))), /*#__PURE__*/React__namespace.createElement("span", {
1165
+ }, displayValue(activeQuery.queryKey, true))), /*#__PURE__*/React__namespace.createElement("span", {
1165
1166
  style: {
1166
1167
  padding: '0.3em .6em',
1167
1168
  borderRadius: '0.4em',
@@ -1301,7 +1302,7 @@ const QueryStatusCount = ({
1301
1302
  }, "inactive ", /*#__PURE__*/React__namespace.createElement(Code, null, "(", hasInactive, ")")));
1302
1303
  };
1303
1304
 
1304
- const QueryRow = ({
1305
+ const QueryRow = /*#__PURE__*/React__namespace.memo(({
1305
1306
  queryKey,
1306
1307
  setActiveQueryHash,
1307
1308
  activeQueryHash,
@@ -1382,8 +1383,7 @@ const QueryRow = ({
1382
1383
  padding: '.5em'
1383
1384
  }
1384
1385
  }, "" + queryHash));
1385
- }; // eslint-disable-next-line @typescript-eslint/no-empty-function
1386
-
1386
+ }); // eslint-disable-next-line @typescript-eslint/no-empty-function
1387
1387
 
1388
1388
  function noop() {}
1389
1389