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

Function sendDevToolsEvent

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

Source from the content-addressed store, hash-verified

2333const DEV_TOOLS_EVENT = '@tanstack/query-devtools-event'
2334
2335const sendDevToolsEvent = ({
2336 type,
2337 queryHash,
2338 metadata,
2339}: {
2340 type: DevToolsActionType
2341 queryHash?: string
2342 metadata?: Record<string, unknown>
2343}) => {
2344 const event = new CustomEvent(DEV_TOOLS_EVENT, {
2345 detail: { type, queryHash, metadata },
2346 bubbles: true,
2347 cancelable: true,
2348 })
2349 window.dispatchEvent(event)
2350}

Callers 5

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

Calls

no outgoing calls

Tested by

no test coverage detected