Replies: 1 comment
-
Yes, you can create a PR. It should be quick. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As per this article we can define a global error handler using a QueryCache configuring its onError handler.
This is somewhat problematic with query global options because it's not possibile to use an injection context during initializazion.
Something like this:
`const factory = (): QueryClientConfig => {
const service = inject(NotificationService);
return {
queryCache: new QueryCache({
onError: (error) => service.notify(error),
}),
};
};
export const appConfig: ApplicationConfig = {
providers: [
provideRouter(appRoutes, withComponentInputBinding()),
provideHttpClient(),
provideQueryClientOptions(factory),
provideQueryDevTools(),
],
};`
Could be an interesting feature?
Beta Was this translation helpful? Give feedback.
All reactions