(app: any, queryClient: QueryClient)
| 21 | * @param queryClient - The client whose query cache is shown in the devtools. |
| 22 | */ |
| 23 | export function setupDevtools(app: any, queryClient: QueryClient) { |
| 24 | setupDevtoolsPlugin( |
| 25 | { |
| 26 | id: pluginId, |
| 27 | label: pluginName, |
| 28 | packageName: 'vue-query', |
| 29 | homepage: 'https://tanstack.com/query/latest', |
| 30 | logo: 'https://raw.githubusercontent.com/TanStack/query/main/packages/vue-query/media/vue-query.svg', |
| 31 | app, |
| 32 | settings: { |
| 33 | baseSort: { |
| 34 | type: 'choice', |
| 35 | component: 'button-group', |
| 36 | label: 'Sort Cache Entries', |
| 37 | options: [ |
| 38 | { |
| 39 | label: 'ASC', |
| 40 | value: 1, |
| 41 | }, |
| 42 | { |
| 43 | label: 'DESC', |
| 44 | value: -1, |
| 45 | }, |
| 46 | ], |
| 47 | defaultValue: 1, |
| 48 | }, |
| 49 | sortFn: { |
| 50 | type: 'choice', |
| 51 | label: 'Sort Function', |
| 52 | options: Object.keys(sortFns).map((key) => ({ |
| 53 | label: key, |
| 54 | value: key, |
| 55 | })), |
| 56 | defaultValue: Object.keys(sortFns)[0]!, |
| 57 | }, |
| 58 | onlineMode: { |
| 59 | type: 'choice', |
| 60 | component: 'button-group', |
| 61 | label: 'Online mode', |
| 62 | options: [ |
| 63 | { |
| 64 | label: 'Online', |
| 65 | value: 1, |
| 66 | }, |
| 67 | { |
| 68 | label: 'Offline', |
| 69 | value: 0, |
| 70 | }, |
| 71 | ], |
| 72 | defaultValue: 1, |
| 73 | }, |
| 74 | }, |
| 75 | }, |
| 76 | (api) => { |
| 77 | const initialSettings = api.getSettings() |
| 78 | onlineManager.setOnline(Boolean(initialSettings.onlineMode.valueOf())) |
| 79 | |
| 80 | const queryCache = queryClient.getQueryCache() |
no test coverage detected