reactjrx 1.73.0 → 1.74.1

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.
@@ -33,7 +33,7 @@ export interface QueryObserverOptions<TQueryFnData = unknown, TError = DefaultEr
33
33
  * If set to a function, the function will be executed with the latest data and query to compute the value.
34
34
  * Defaults to `true`.
35
35
  */
36
- refetchOnWindowFocus?: boolean | "always" | ((query: Query<TQueryFnData, TError, TQueryData, TQueryKey>) => boolean | "always");
36
+ refetchOnWindowFocus?: boolean | "idle" | "always" | ((query: Query<TQueryFnData, TError, TQueryData, TQueryKey>) => boolean | "always");
37
37
  /**
38
38
  * If set to `true`, the query will refetch on reconnect if the data is stale.
39
39
  * If set to `false`, the query will not refetch on reconnect.
@@ -41,15 +41,16 @@ export interface QueryObserverOptions<TQueryFnData = unknown, TError = DefaultEr
41
41
  * If set to a function, the function will be executed with the latest data and query to compute the value.
42
42
  * Defaults to the value of `networkOnline` (`true`)
43
43
  */
44
- refetchOnReconnect?: boolean | "always" | ((query: Query<TQueryFnData, TError, TQueryData, TQueryKey>) => boolean | "always");
44
+ refetchOnReconnect?: boolean | "idle" | "always" | ((query: Query<TQueryFnData, TError, TQueryData, TQueryKey>) => boolean | "always");
45
45
  /**
46
46
  * If set to `true`, the query will refetch on mount if the data is stale.
47
47
  * If set to `false`, will disable additional instances of a query to trigger background refetches.
48
48
  * If set to `'always'`, the query will always refetch on mount.
49
+ * If set to `'always'`, the query will always refetch on mount if idle.
49
50
  * If set to a function, the function will be executed with the latest data and query to compute the value
50
51
  * Defaults to `true`.
51
52
  */
52
- refetchOnMount?: boolean | "always" | ((query: Query<TQueryFnData, TError, TQueryData, TQueryKey>) => boolean | "always");
53
+ refetchOnMount?: boolean | "idle" | "always" | ((query: Query<TQueryFnData, TError, TQueryData, TQueryKey>) => boolean | "always");
53
54
  /**
54
55
  * If set to `false`, the query will not be retried on mount if it contains an error.
55
56
  * Defaults to `true`.
@@ -0,0 +1,7 @@
1
+ import { type Observable } from "rxjs";
2
+ import { type QueryState } from "../types";
3
+ export declare const whenNewData: <TQueryFnData = unknown, TError = Error, TData = TQueryFnData>(source: Observable<Partial<QueryState<TData, TError>>>) => Observable<{
4
+ data: TData | undefined;
5
+ status: import("../../types").QueryStatus | undefined;
6
+ dataUpdatedAt: number | undefined;
7
+ }>;
@@ -0,0 +1,8 @@
1
+ import { type QueryClient } from "../../client/QueryClient";
2
+ import { type QueryKey } from "../../client/keys/types";
3
+ import { type DefaultError } from "../../client/types";
4
+ import { type DefinedInitialDataOptions, type UndefinedInitialDataOptions } from "./queryOptions";
5
+ import { type DefinedUseQueryResult, type UseQueryOptions, type UseQueryResult } from "./types";
6
+ export declare function useForeverQuery<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>, queryClient?: QueryClient): UseQueryResult<TData, TError>;
7
+ export declare function useForeverQuery<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError>;
8
+ export declare function useForeverQuery<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, queryClient?: QueryClient): UseQueryResult<TData, TError>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "reactjrx",
3
3
  "private": false,
4
- "version": "1.73.0",
4
+ "version": "1.74.1",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"