Skip to content
Source
Sign inSign up
TanStack/query

fix(angular-query): do not run callbacks in injection context #8817

Mergedarnoud-dv(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/8817/headmerged by arnoud-dv(GitHub profile, opens in a new tab) View on GitHub

Showing 7 changed files with 5 additions and 49 deletions (loading 4).

x
0 of 7 viewed, 7 left
4 additions and 5 deletionspackages/angular-query-devtools-experimental/src/inject-devtools-panel.tsModified
View file
@@ -38,11 +38,13 @@
const currentInjector = injector ?? inject(Injector)
​
return runInInjectionContext(currentInjector, () => {
+ const destroyRef = inject(DestroyRef)
+ const isBrowser = isPlatformBrowser(inject(PLATFORM_ID))
+ const injectedClient = inject(QueryClient, { optional: true })
+​
const options = computed(optionsFn)
let devtools: TanstackQueryDevtoolsPanel | null = null
​
- const isBrowser = isPlatformBrowser(inject(PLATFORM_ID))
-​
const destroy = () => {
devtools?.unmount()
devtools = null
@@ -53,10 +55,7 @@
destroy,
​
- const destroyRef = inject(DestroyRef)
-​
effect(() => {
- const injectedClient = currentInjector.get(QueryClient, null)
const {