reactjrx 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5,14 +5,13 @@ export type ObservableQueryFn<TQueryFnData = unknown, TQueryKey extends QueryKey
|
|
|
5
5
|
* Bridges an Observable-based `queryFn` to the Promise-based `queryFn`
|
|
6
6
|
* expected by TanStack Query. Shared by `useQuery$` and `useQueries$`.
|
|
7
7
|
*
|
|
8
|
-
* Every value is written into the query as soon as the stream emits it.
|
|
9
|
-
* fetch TanStack starts (mount, `refetch()`, `invalidateQueries()`...)
|
|
10
|
-
* once the stream has a value in the cache, like a
|
|
11
|
-
* it settles. Right after it, the bridge starts a
|
|
12
|
-
* stream: it keeps the query `fetching` while the
|
|
13
|
-
* the stream completes or errors.
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* the stream.
|
|
8
|
+
* Every value is written into the query as soon as the stream emits it. Each
|
|
9
|
+
* fetch TanStack starts (mount, `refetch()`, `invalidateQueries()`...) runs
|
|
10
|
+
* the `queryFn` and ends once the stream has a value in the cache, like a
|
|
11
|
+
* regular query, so awaiting it settles. Right after it, the bridge starts a
|
|
12
|
+
* fetch that follows the stream: it keeps the query `fetching` while the
|
|
13
|
+
* stream runs and ends when the stream completes or errors. Cancelling the
|
|
14
|
+
* fetch in progress (a refetch replacing it, the last observer unmounting,
|
|
15
|
+
* `cancelQueries`, the query leaving the cache) stops the stream.
|
|
17
16
|
*/
|
|
18
17
|
export declare function createObservableQueryFn<TQueryFnData = unknown, TQueryKey extends QueryKey = QueryKey>(queryFn: ObservableQueryFn<TQueryFnData, TQueryKey> | undefined): typeof skipToken | ((context: QueryFunctionContext<TQueryKey>) => Promise<TQueryFnData>) | undefined;
|