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

BaseQueryNarrowing.md

28 lines1.3 KB

1---
2id: BaseQueryNarrowing
3title: BaseQueryNarrowing
4---
5​
6<!-- DO NOT EDIT: this page is autogenerated from the type comments -->
7​
8Defined in: [packages/angular-query/src/types.ts:72](https://github.com/TanStack/query/blob/main/packages/angular-query/src/types.ts#L72)
9​
10Signal-backed guards that narrow a query result and its data and error fields by status.
11​
12## Type Parameters
13​
14### TData
15​
16`TData` = `unknown`
17​
18### TError
19​
20`TError` = [`DefaultError`](../type-aliases/DefaultError.md)
21​
22## Properties
23​
24| Property | Type | Description |
25| ------ | ------ | ------ |
26| <a id="property-iserror"></a> `isError` | `SignalFunction`\<() => `this is CreateBaseQueryResult<TData, TError, CreateStatusBasedQueryResult<"error", TData, TError>>`\> | Returns whether the result failed and narrows its data and error signals. |
27| <a id="property-ispending"></a> `isPending` | `SignalFunction`\<() => `this is CreateBaseQueryResult<TData, TError, CreateStatusBasedQueryResult<"pending", TData, TError>>`\> | Narrows the result to the pending state when that state is possible. |
28| <a id="property-issuccess"></a> `isSuccess` | `SignalFunction`\<() => `this is CreateBaseQueryResult<TData, TError, CreateStatusBasedQueryResult<"success", TData, TError>>`\> | Returns whether the result is successful and narrows its data and error signals. |