mirror of
https://github.com/TanStack/query.git
synced 2026-11-18 19:33:22 +00:00
* chore(scripts/generate-docs): read type alias bodies whose type parameters have defaults * chore(*): update '@tanstack/typedoc-config' to v0.3.5
1.9 KiB
1.9 KiB
| id | title |
|---|---|
| BaseQueryNarrowing | BaseQueryNarrowing |
Defined in: packages/angular-query-experimental/src/types.ts:80
The isSuccess/isError/isPending methods on a query result. Unlike react-query's derived booleans,
these are type-guard methods you call — if (query.isSuccess()) — so that query.data narrows away
undefined inside the branch, the same way status narrowing works on the plain object react-query
returns.
Type Parameters
TData
TData = unknown
The type data ends up as after select runs.
TError
TError = DefaultError
The type of errors your queryFn may throw.
Properties
| Property | Type | Description |
|---|---|---|
isError |
(this: CreateBaseQueryResult<TData, TError>) => this is CreateBaseQueryResult<TData, TError, CreateStatusBasedQueryResult<"error", TData, TError>> |
Returns true if the query is in the error state, narrowing the result to that state. |
isPending |
(this: CreateBaseQueryResult<TData, TError>) => this is CreateBaseQueryResult<TData, TError, CreateStatusBasedQueryResult<"pending", TData, TError>> |
Returns true if the query is in the pending state, narrowing the result to that state. |
isSuccess |
(this: CreateBaseQueryResult<TData, TError>) => this is CreateBaseQueryResult<TData, TError, CreateStatusBasedQueryResult<"success", TData, TError>> |
Returns true if the query is in the success state, narrowing the result to that state. |