Skip to content

Commit 38504ac

Browse files
authored
fix(vue-query): show timeline events in the Vue.js devtools (#5712)
1 parent 58573e9 commit 38504ac

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/vue-query/src/devtools/devtools.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { setupDevtoolsPlugin } from '@vue/devtools-api'
44
import type { CustomInspectorNode } from '@vue/devtools-api'
55
import { rankItem } from '@tanstack/match-sorter-utils'
6-
import type { Query } from '@tanstack/query-core'
6+
import type { Query, QueryCacheNotifyEvent } from '@tanstack/query-core'
77
import type { QueryClient } from '../queryClient'
88
import {
99
getQueryStateLabel,
@@ -103,10 +103,15 @@ export function setupDevtools(app: any, queryClient: QueryClient) {
103103
api.sendInspectorTree(pluginId)
104104
api.sendInspectorState(pluginId)
105105

106+
const queryEvents: QueryCacheNotifyEvent['type'][] = [
107+
'added',
108+
'removed',
109+
'updated',
110+
]
106111
if (
107112
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
108113
event &&
109-
['queryAdded', 'queryRemoved', 'queryUpdated'].includes(event.type)
114+
queryEvents.includes(event.type)
110115
) {
111116
api.addTimelineEvent({
112117
layerId: pluginId,

0 commit comments

Comments
 (0)