TanStackT
TanStack3y ago
1 reply
skinny-azure

angular-use-query: track refetches

Hello,

I'm using angular v17. I would like to monitor the query changes from tanstack query, and publish the results to a local store of mine. Basically, each time it refetches, i would like to be notified somehow, so i can retrieve the latest data,errors,isFetching,etc and publish them.

I could imagine an API like this:

const query = injectQuery(() => ({
   queryKey,
   queryFn,
}));

query.monitorChanges((data,isError,isFetching,...)=>{
  publisher.publish({
    ...
  });
})


If there are other approaches to this problem, please enlighten me
Was this page helpful?