Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

index.ts

13 lines374 Bytes

1export function shouldThrowError<T extends (...args: Array<any>) => boolean>(
2 throwError: boolean | T | undefined,
3 params: Parameters<T>,
4): boolean {
5 // Allow throwError function to override throwing behavior on a per-error basis
6 if (typeof throwError === 'function') {
7 return throwError(...params)
8 }
9​
10 return !!throwError
12​
13export function noop(): void {}