@tanstack/react-query-devtools 5.0.0-alpha.12 → 5.0.0-alpha.14
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/lib/CachePanel/ActiveQuery.d.ts +18 -0
- package/build/lib/CachePanel/ActiveQuery.esm.js +271 -0
- package/build/lib/CachePanel/ActiveQuery.esm.js.map +1 -0
- package/build/lib/CachePanel/ActiveQuery.js +275 -0
- package/build/lib/CachePanel/ActiveQuery.js.map +1 -0
- package/build/lib/CachePanel/ActiveQuery.mjs +257 -0
- package/build/lib/CachePanel/ActiveQuery.mjs.map +1 -0
- package/build/lib/CachePanel/CachePanel.d.ts +57 -0
- package/build/lib/CachePanel/CachePanel.esm.js +301 -0
- package/build/lib/CachePanel/CachePanel.esm.js.map +1 -0
- package/build/lib/CachePanel/CachePanel.js +306 -0
- package/build/lib/CachePanel/CachePanel.js.map +1 -0
- package/build/lib/CachePanel/CachePanel.mjs +301 -0
- package/build/lib/CachePanel/CachePanel.mjs.map +1 -0
- package/build/lib/CachePanel/Header/QueryStatusCount.d.ts +7 -0
- package/build/lib/CachePanel/Header/QueryStatusCount.esm.js +49 -0
- package/build/lib/CachePanel/Header/QueryStatusCount.esm.js.map +1 -0
- package/build/lib/CachePanel/Header/QueryStatusCount.js +53 -0
- package/build/lib/CachePanel/Header/QueryStatusCount.js.map +1 -0
- package/build/lib/CachePanel/Header/QueryStatusCount.mjs +49 -0
- package/build/lib/CachePanel/Header/QueryStatusCount.mjs.map +1 -0
- package/build/lib/CachePanel/QueryRow.d.ts +13 -0
- package/build/lib/CachePanel/QueryRow.esm.js +98 -0
- package/build/lib/CachePanel/QueryRow.esm.js.map +1 -0
- package/build/lib/CachePanel/QueryRow.js +102 -0
- package/build/lib/CachePanel/QueryRow.js.map +1 -0
- package/build/lib/CachePanel/QueryRow.mjs +82 -0
- package/build/lib/CachePanel/QueryRow.mjs.map +1 -0
- package/build/lib/devtools.d.ts +3 -64
- package/build/lib/devtools.esm.js +2 -669
- package/build/lib/devtools.esm.js.map +1 -1
- package/build/lib/devtools.js +3 -669
- package/build/lib/devtools.js.map +1 -1
- package/build/lib/devtools.mjs +2 -639
- package/build/lib/devtools.mjs.map +1 -1
- package/build/lib/index.esm.js +2 -1
- package/build/lib/index.esm.js.map +1 -1
- package/build/lib/index.js +2 -1
- package/build/lib/index.js.map +1 -1
- package/build/lib/index.mjs +2 -1
- package/build/lib/index.mjs.map +1 -1
- package/build/lib/index.prod.esm.js +745 -713
- package/build/lib/index.prod.esm.js.map +1 -1
- package/build/lib/index.prod.js +742 -710
- package/build/lib/index.prod.js.map +1 -1
- package/build/lib/index.prod.mjs +745 -713
- package/build/lib/index.prod.mjs.map +1 -1
- package/build/lib/styledComponents.esm.js +8 -0
- package/build/lib/styledComponents.esm.js.map +1 -1
- package/build/lib/styledComponents.js +8 -0
- package/build/lib/styledComponents.js.map +1 -1
- package/build/lib/styledComponents.mjs +8 -0
- package/build/lib/styledComponents.mjs.map +1 -1
- package/build/lib/types.d.ts +11 -0
- package/build/lib/useSubscribeToQueryCache.d.ts +3 -0
- package/build/lib/useSubscribeToQueryCache.esm.js +15 -0
- package/build/lib/useSubscribeToQueryCache.esm.js.map +1 -0
- package/build/lib/useSubscribeToQueryCache.js +19 -0
- package/build/lib/useSubscribeToQueryCache.js.map +1 -0
- package/build/lib/useSubscribeToQueryCache.mjs +15 -0
- package/build/lib/useSubscribeToQueryCache.mjs.map +1 -0
- package/build/umd/index.development.js +2385 -2353
- package/build/umd/index.development.js.map +1 -1
- package/package.json +1 -1
- package/src/CachePanel/ActiveQuery.tsx +380 -0
- package/src/CachePanel/CachePanel.tsx +427 -0
- package/src/CachePanel/Header/QueryStatusCount.tsx +93 -0
- package/src/CachePanel/QueryRow.tsx +125 -0
- package/src/devtools.tsx +5 -1008
- package/src/styledComponents.ts +16 -0
- package/src/types.ts +12 -0
- package/src/useSubscribeToQueryCache.ts +26 -0
package/src/styledComponents.ts
CHANGED
|
@@ -20,6 +20,8 @@ export const Panel = styled(
|
|
|
20
20
|
},
|
|
21
21
|
)
|
|
22
22
|
|
|
23
|
+
Panel.displayName = 'Panel'
|
|
24
|
+
|
|
23
25
|
export const ActiveQueryPanel = styled(
|
|
24
26
|
'div',
|
|
25
27
|
() => ({
|
|
@@ -36,6 +38,8 @@ export const ActiveQueryPanel = styled(
|
|
|
36
38
|
},
|
|
37
39
|
)
|
|
38
40
|
|
|
41
|
+
ActiveQueryPanel.displayName = 'ActiveQueryPanel'
|
|
42
|
+
|
|
39
43
|
export const Button = styled('button', (props, theme) => ({
|
|
40
44
|
appearance: 'none',
|
|
41
45
|
fontSize: '.9em',
|
|
@@ -49,6 +53,8 @@ export const Button = styled('button', (props, theme) => ({
|
|
|
49
53
|
cursor: 'pointer',
|
|
50
54
|
}))
|
|
51
55
|
|
|
56
|
+
Button.displayName = 'Button'
|
|
57
|
+
|
|
52
58
|
export const QueryKeys = styled('span', {
|
|
53
59
|
display: 'flex',
|
|
54
60
|
flexWrap: 'wrap',
|
|
@@ -56,6 +62,8 @@ export const QueryKeys = styled('span', {
|
|
|
56
62
|
fontSize: '0.9em',
|
|
57
63
|
})
|
|
58
64
|
|
|
65
|
+
QueryKeys.displayName = 'QueryKeys'
|
|
66
|
+
|
|
59
67
|
export const QueryKey = styled('span', {
|
|
60
68
|
display: 'inline-flex',
|
|
61
69
|
alignItems: 'center',
|
|
@@ -65,12 +73,16 @@ export const QueryKey = styled('span', {
|
|
|
65
73
|
borderRadius: '.2em',
|
|
66
74
|
})
|
|
67
75
|
|
|
76
|
+
QueryKey.displayName = 'QueryKey'
|
|
77
|
+
|
|
68
78
|
export const Code = styled('code', {
|
|
69
79
|
fontSize: '.9em',
|
|
70
80
|
color: 'inherit',
|
|
71
81
|
background: 'inherit',
|
|
72
82
|
})
|
|
73
83
|
|
|
84
|
+
Code.displayName = 'Code'
|
|
85
|
+
|
|
74
86
|
export const Input = styled('input', (_props, theme) => ({
|
|
75
87
|
backgroundColor: theme.inputBackgroundColor,
|
|
76
88
|
border: 0,
|
|
@@ -81,6 +93,8 @@ export const Input = styled('input', (_props, theme) => ({
|
|
|
81
93
|
padding: '.3em .4em',
|
|
82
94
|
}))
|
|
83
95
|
|
|
96
|
+
Input.displayName = 'Input'
|
|
97
|
+
|
|
84
98
|
export const Select = styled(
|
|
85
99
|
'select',
|
|
86
100
|
(_props, theme) => ({
|
|
@@ -108,3 +122,5 @@ export const Select = styled(
|
|
|
108
122
|
},
|
|
109
123
|
},
|
|
110
124
|
)
|
|
125
|
+
|
|
126
|
+
Select.displayName = 'Select'
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import type { QueryCache } from '@tanstack/react-query'
|
|
3
|
+
import { notifyManager } from '@tanstack/react-query'
|
|
4
|
+
|
|
5
|
+
const useSubscribeToQueryCache = <T>(
|
|
6
|
+
queryCache: QueryCache,
|
|
7
|
+
getSnapshot: () => T,
|
|
8
|
+
skip: boolean = false,
|
|
9
|
+
): T => {
|
|
10
|
+
return React.useSyncExternalStore(
|
|
11
|
+
React.useCallback(
|
|
12
|
+
(onStoreChange) => {
|
|
13
|
+
if (!skip)
|
|
14
|
+
return queryCache.subscribe(notifyManager.batchCalls(onStoreChange))
|
|
15
|
+
return () => {
|
|
16
|
+
return
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
[queryCache, skip],
|
|
20
|
+
),
|
|
21
|
+
getSnapshot,
|
|
22
|
+
getSnapshot,
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default useSubscribeToQueryCache
|