Skip to content
Discussion options

You must be logged in to vote

This is just an idea, couldn't you just pass an injector instance with your own query client?

https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-query-client.ts

const customInjector = Injector.create({
  providers: [
   provideQueryClient(customQueryClient)
  ]
})
const query = injectQuery(() => { ... }, customInjector);

You'll probably have to mount/unmount the queryclient by yourself like the code provideAngularQuery implementation
https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L50-L64

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by OmerGronich
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants