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

BaseQueryNarrowing.md

28 lines1.3 KB

Defined in: packages/angular-query/src/types.ts:72

Signal-backed guards that narrow a query result and its data and error fields by status.

Type Parameters

TData

TData = unknown

TError

TError = DefaultError

Properties

PropertyTypeDescription
isErrorSignalFunction<() => this is CreateBaseQueryResult<TData, TError, CreateStatusBasedQueryResult<"error", TData, TError>>>Returns whether the result failed and narrows its data and error signals.
isPendingSignalFunction<() => this is CreateBaseQueryResult<TData, TError, CreateStatusBasedQueryResult<"pending", TData, TError>>>Narrows the result to the pending state when that state is possible.
isSuccessSignalFunction<() => this is CreateBaseQueryResult<TData, TError, CreateStatusBasedQueryResult<"success", TData, TError>>>Returns whether the result is successful and narrows its data and error signals.