const subCollection = createCollection(
queryCollectionOptions({
queryClient: queryClient,
queryKey: ['...'],
queryFn: async () => {
return [] as PullRequestStatus[];
},
getKey: item => item.id,
}),
);
const mainCollection = createCollection(
queryCollectionOptions({
queryClient: queryClient,
queryKey: ['sync'],
queryFn: async () => {
const { data } = await http
.get(`sync`)
.json();
data.forEach(data => {
subCollection.utils.writeUpsert(data.subData);
});
return data
},
getKey: item => item.id,
})
const subCollection = createCollection(
queryCollectionOptions({
queryClient: queryClient,
queryKey: ['...'],
queryFn: async () => {
return [] as PullRequestStatus[];
},
getKey: item => item.id,
}),
);
const mainCollection = createCollection(
queryCollectionOptions({
queryClient: queryClient,
queryKey: ['sync'],
queryFn: async () => {
const { data } = await http
.get(`sync`)
.json();
data.forEach(data => {
subCollection.utils.writeUpsert(data.subData);
});
return data
},
getKey: item => item.id,
})