MCPcopy Create free account
hub / github.com/TanStack/query / sendDevToolsEvent

Function sendDevToolsEvent

packages/query-devtools/src/Devtools.tsx:2325–2340  ·  view source on GitHub ↗
({
  type,
  queryHash,
  metadata,
}: {
  type: DevToolsActionType
  queryHash?: string
  metadata?: Record<string, unknown>
})

Source from the content-addressed store, hash-verified

2323const DEV_TOOLS_EVENT = '@tanstack/query-devtools-event'
2324
2325const sendDevToolsEvent = ({
2326 type,
2327 queryHash,
2328 metadata,
2329}: {
2330 type: DevToolsActionType
2331 queryHash?: string
2332 metadata?: Record<string, unknown>
2333}) => {
2334 const event = new CustomEvent(DEV_TOOLS_EVENT, {
2335 detail: { type, queryHash, metadata },
2336 bubbles: true,
2337 cancelable: true,
2338 })
2339 window.dispatchEvent(event)
2340}

Callers 5

ContentViewFunction · 0.85
handleRefetchFunction · 0.85
triggerErrorFunction · 0.85
QueryDetailsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected