MCPcopy Create free account
hub / github.com/IQEngine/IQEngine / useQueryTrack

Function useQueryTrack

client/src/api/metadata/queries.ts:51–63  ·  view source on GitHub ↗
(type: string, account: string, container: string, filepath: string, enabled = true)

Source from the content-addressed store, hash-verified

49};
50
51export const useQueryTrack = (type: string, account: string, container: string, filepath: string, enabled = true) => {
52 const { dataSourcesQuery, filesQuery } = useUserSettings();
53 const { instance } = useMsal();
54 const client = MetadataClientFactory(type, filesQuery.data, dataSourcesQuery.data, instance);
55
56 return useQuery<number[][]>({
57 queryKey: ['track', account, container, filepath ],
58 queryFn: ({signal}) => {
59 return client.track(account, container, filepath, signal);
60 },
61 enabled: enabled && !!filesQuery.data && !!dataSourcesQuery.data,
62 });
63};
64
65export const getMeta = (type: string, account: string, container: string, filePath: string, enabled = true) => {
66 const { dataSourcesQuery, filesQuery } = useUserSettings();

Callers 2

MetadataQueryFunction · 0.90
SmartQueryFunction · 0.90

Calls 3

useUserSettingsFunction · 0.90
MetadataClientFactoryFunction · 0.90
trackMethod · 0.65

Tested by

no test coverage detected