Skip to content
Source
Sign inSign up
TanStack/query

feat(query-core, react-query): add experimental query handles #12512

DraftKATT(GitHub profile, opens in a new tab)wants to merge 30 commits intomain fromrefs/pull/12512/headopened View on GitHub

Showing 20 changed files with 6 additions and 0 deletions (loading 19).

x
0 of 20 viewed, 20 left
6 additions and 0 deletions.changeset/experimental-query-handles.mdAdded
View file
@@ -0,0 +1,6 @@
+---
+'@tanstack/query-core': minor
+'@tanstack/react-query': minor
+---
+​
+Add experimental query handles. `experimental_queryHandle`, `experimental_queryHandleAsync` and `experimental_ensureQueryHandle` start a query from a query factory and return a small serializable handle: the first doesn't wait, the second waits for fresh data, and the third waits for any data, even if it is stale. `experimental_fromHandle` rebuilds the query's options from a handle. `experimental_getQueryHandleData` reads the data of a handle that one of the awaited functions returned. `experimental_InferQueryHandleData` gives the type of the data a reader gets from a factory or handle.
docs/framework/react/guides/query-handles.mdAdded
View file
Loading the diff
docs/config.jsonModified
View file
Loading the diff
packages/query-core/src/__tests__/handles.test.tsxAdded
View file
Loading the diff
packages/query-core/src/handles.tsAdded
View file
Loading the diff
packages/query-core/src/index.tsModified
View file
Loading the diff
packages/query-test-utils/src/__tests__/clearOnDispose.test.tsAdded
View file
Loading the diff
packages/query-test-utils/src/__tests__/fakeTimers.test.tsAdded
View file
Loading the diff
packages/query-test-utils/src/__tests__/subscribe.test.tsAdded
View file
Loading the diff