@tanstack/pacer-devtools 1.4.0 → 1.5.0

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.
@@ -1,33 +0,0 @@
1
- /** TanStack Store (`@tanstack/store`) used by pacer utils. */
2
- export function isPacerUtilTanStackStore(x: unknown): x is {
3
- subscribe: (cb: (s: unknown) => void) => { unsubscribe: () => void }
4
- get: () => unknown
5
- } {
6
- return (
7
- typeof x === 'object' &&
8
- x !== null &&
9
- 'subscribe' in x &&
10
- typeof (x as { subscribe: unknown }).subscribe === 'function' &&
11
- 'get' in x &&
12
- typeof (x as { get: unknown }).get === 'function'
13
- )
14
- }
15
-
16
- /**
17
- * Core pacer utils expose TanStack `Store` (`get()` / `state`). React hooks may
18
- * also expose a reactive `state` field. Use this for devtools UI that needs a
19
- * plain snapshot (e.g. JsonTree).
20
- */
21
- export function getPacerUtilStoreState(instance: {
22
- store?: { get?: () => unknown; state?: unknown }
23
- state?: unknown
24
- }): unknown {
25
- const store = instance.store
26
- if (store && typeof store.get === 'function') {
27
- return store.get()
28
- }
29
- if (store && store.state !== undefined) {
30
- return store.state
31
- }
32
- return instance.state
33
- }