@tanstack/react-query-persist-client 5.105.0 → 5.105.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.
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- //#region \0rolldown/runtime.js
3
+ // \0rolldown/runtime.js
4
4
  var __create = Object.create;
5
5
  var __defProp = Object.defineProperty;
6
6
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -21,13 +21,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
21
  value: mod,
22
22
  enumerable: true
23
23
  }) : target, mod));
24
- //#endregion
25
24
  let react = require("react");
26
25
  react = __toESM(react, 1);
27
26
  let _tanstack_query_persist_client_core = require("@tanstack/query-persist-client-core");
28
27
  let _tanstack_react_query = require("@tanstack/react-query");
29
28
  let react_jsx_runtime = require("react/jsx-runtime");
30
- //#region src/PersistQueryClientProvider.tsx
29
+ // src/PersistQueryClientProvider.tsx
31
30
  /**
32
31
  * Provides the `QueryClient` like `QueryClientProvider`, and restores the persisted client first:
33
32
  * while restoring, `useIsRestoring` returns `true` and queries wait for the restore to finish
@@ -80,7 +79,6 @@ const PersistQueryClientProvider = ({ children, persistOptions, onSuccess, onErr
80
79
  })
81
80
  });
82
81
  };
83
- //#endregion
84
82
  exports.PersistQueryClientProvider = PersistQueryClientProvider;
85
83
 
86
84
  //# sourceMappingURL=PersistQueryClientProvider.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"PersistQueryClientProvider.cjs","names":["React","persistQueryClientSubscribe","QueryClientProvider","IsRestoringProvider"],"sources":["../../src/PersistQueryClientProvider.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport {\n persistQueryClientRestore,\n persistQueryClientSubscribe,\n} from '@tanstack/query-persist-client-core'\nimport { IsRestoringProvider, QueryClientProvider } from '@tanstack/react-query'\nimport type { PersistQueryClientOptions } from '@tanstack/query-persist-client-core'\nimport type { OmitKeyof, QueryClientProviderProps } from '@tanstack/react-query'\n\n/**\n * The props of `PersistQueryClientProvider`: the props of `QueryClientProvider`, plus the\n * `persistOptions` and callbacks for when restoring succeeds or fails.\n */\nexport type PersistQueryClientProviderProps = QueryClientProviderProps & {\n persistOptions: OmitKeyof<PersistQueryClientOptions, 'queryClient'>\n onSuccess?: () => Promise<unknown> | unknown\n onError?: () => Promise<unknown> | unknown\n}\n\n/**\n * Provides the `QueryClient` like `QueryClientProvider`, and restores the persisted client first:\n * while restoring, `useIsRestoring` returns `true` and queries wait for the restore to finish\n * before subscribing. Once restored, the client is saved with the persister whenever the cache\n * changes.\n * @param props - The `QueryClientProvider` props, the `persistOptions`, and the `onSuccess` and\n * `onError` callbacks. `onSuccess` is called once restoring finishes, even if nothing was restored\n * (e.g. because the persisted client expired), and `onError` if restoring or `onSuccess` throws.\n * @returns The `QueryClientProvider` wrapping the children.\n */\nexport const PersistQueryClientProvider = ({\n children,\n persistOptions,\n onSuccess,\n onError,\n ...props\n}: PersistQueryClientProviderProps): React.JSX.Element => {\n const [isRestoring, setIsRestoring] = React.useState(true)\n const optionsRef = React.useRef({ persistOptions, onSuccess, onError })\n const didRestoreRef = React.useRef(false)\n\n React.useEffect(() => {\n optionsRef.current = { persistOptions, onSuccess, onError }\n })\n\n React.useEffect(() => {\n const options = {\n ...optionsRef.current.persistOptions,\n queryClient: props.client,\n }\n if (!didRestoreRef.current) {\n didRestoreRef.current = true\n persistQueryClientRestore(options)\n .then(() => optionsRef.current.onSuccess?.())\n .catch(() => optionsRef.current.onError?.())\n .finally(() => {\n setIsRestoring(false)\n })\n }\n return isRestoring ? undefined : persistQueryClientSubscribe(options)\n }, [props.client, isRestoring])\n\n return (\n <QueryClientProvider {...props}>\n <IsRestoringProvider value={isRestoring}>{children}</IsRestoringProvider>\n </QueryClientProvider>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAa,8BAA8B,EACzC,UACA,gBACA,WACA,SACA,GAAG,YACqD;CACxD,MAAM,CAAC,aAAa,kBAAkBA,MAAM,SAAS,IAAI;CACzD,MAAM,aAAaA,MAAM,OAAO;EAAE;EAAgB;EAAW;CAAQ,CAAC;CACtE,MAAM,gBAAgBA,MAAM,OAAO,KAAK;CAExC,MAAM,gBAAgB;EACpB,WAAW,UAAU;GAAE;GAAgB;GAAW;EAAQ;CAC5D,CAAC;CAED,MAAM,gBAAgB;EACpB,MAAM,UAAU;GACd,GAAG,WAAW,QAAQ;GACtB,aAAa,MAAM;EACrB;EACA,IAAI,CAAC,cAAc,SAAS;GAC1B,cAAc,UAAU;GACxB,CAAA,GAAA,oCAAA,0BAAA,CAA0B,OAAO,CAAC,CAC/B,WAAW;;IAAW,QAAA,yBAAA,sBAAA,WAAA,QAAA,CAAQ,eAAA,QAAA,0BAAA,KAAA,IAAA,KAAA,IAAA,sBAAA,KAAA,mBAAY;GAAC,CAAA,CAAC,CAC5C,YAAY;;IAAW,QAAA,0BAAA,uBAAA,WAAA,QAAA,CAAQ,aAAA,QAAA,2BAAA,KAAA,IAAA,KAAA,IAAA,uBAAA,KAAA,oBAAU;GAAC,CAAA,CAAC,CAC3C,cAAc;IACb,eAAe,KAAK;GACtB,CAAC;EACL;EACA,OAAO,cAAc,KAAA,KAAA,GAAYC,oCAAAA,4BAAAA,CAA4B,OAAO;CACtE,GAAG,CAAC,MAAM,QAAQ,WAAW,CAAC;CAE9B,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,qBAAD;EAAqB,GAAI;EACvB,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,qBAAD;GAAqB,OAAO;GAAc;EAA8B,CAAA;CACrD,CAAA;AAEzB"}
1
+ {"version":3,"file":"PersistQueryClientProvider.cjs","names":["React","persistQueryClientSubscribe","QueryClientProvider","IsRestoringProvider"],"sources":["../../src/PersistQueryClientProvider.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport {\n persistQueryClientRestore,\n persistQueryClientSubscribe,\n} from '@tanstack/query-persist-client-core'\nimport { IsRestoringProvider, QueryClientProvider } from '@tanstack/react-query'\nimport type { PersistQueryClientOptions } from '@tanstack/query-persist-client-core'\nimport type { OmitKeyof, QueryClientProviderProps } from '@tanstack/react-query'\n\n/**\n * The props of `PersistQueryClientProvider`: the props of `QueryClientProvider`, plus the\n * `persistOptions` and callbacks for when restoring succeeds or fails.\n */\nexport type PersistQueryClientProviderProps = QueryClientProviderProps & {\n persistOptions: OmitKeyof<PersistQueryClientOptions, 'queryClient'>\n onSuccess?: () => Promise<unknown> | unknown\n onError?: () => Promise<unknown> | unknown\n}\n\n/**\n * Provides the `QueryClient` like `QueryClientProvider`, and restores the persisted client first:\n * while restoring, `useIsRestoring` returns `true` and queries wait for the restore to finish\n * before subscribing. Once restored, the client is saved with the persister whenever the cache\n * changes.\n * @param props - The `QueryClientProvider` props, the `persistOptions`, and the `onSuccess` and\n * `onError` callbacks. `onSuccess` is called once restoring finishes, even if nothing was restored\n * (e.g. because the persisted client expired), and `onError` if restoring or `onSuccess` throws.\n * @returns The `QueryClientProvider` wrapping the children.\n */\nexport const PersistQueryClientProvider = ({\n children,\n persistOptions,\n onSuccess,\n onError,\n ...props\n}: PersistQueryClientProviderProps): React.JSX.Element => {\n const [isRestoring, setIsRestoring] = React.useState(true)\n const optionsRef = React.useRef({ persistOptions, onSuccess, onError })\n const didRestoreRef = React.useRef(false)\n\n React.useEffect(() => {\n optionsRef.current = { persistOptions, onSuccess, onError }\n })\n\n React.useEffect(() => {\n const options = {\n ...optionsRef.current.persistOptions,\n queryClient: props.client,\n }\n if (!didRestoreRef.current) {\n didRestoreRef.current = true\n persistQueryClientRestore(options)\n .then(() => optionsRef.current.onSuccess?.())\n .catch(() => optionsRef.current.onError?.())\n .finally(() => {\n setIsRestoring(false)\n })\n }\n return isRestoring ? undefined : persistQueryClientSubscribe(options)\n }, [props.client, isRestoring])\n\n return (\n <QueryClientProvider {...props}>\n <IsRestoringProvider value={isRestoring}>{children}</IsRestoringProvider>\n </QueryClientProvider>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAa,8BAA8B,EACzC,UACA,gBACA,WACA,SACA,GAAG,YACqD;CACxD,MAAM,CAAC,aAAa,kBAAkBA,MAAM,SAAS,IAAI;CACzD,MAAM,aAAaA,MAAM,OAAO;EAAE;EAAgB;EAAW;CAAQ,CAAC;CACtE,MAAM,gBAAgBA,MAAM,OAAO,KAAK;CAExC,MAAM,gBAAgB;EACpB,WAAW,UAAU;GAAE;GAAgB;GAAW;EAAQ;CAC5D,CAAC;CAED,MAAM,gBAAgB;EACpB,MAAM,UAAU;GACd,GAAG,WAAW,QAAQ;GACtB,aAAa,MAAM;EACrB;EACA,IAAI,CAAC,cAAc,SAAS;GAC1B,cAAc,UAAU;GACxB,CAAA,GAAA,oCAAA,0BAAA,CAA0B,OAAO,CAAC,CAC/B,WAAW;;IAAW,QAAA,yBAAA,sBAAA,WAAA,QAAA,CAAQ,eAAA,QAAA,0BAAA,KAAA,IAAA,KAAA,IAAA,sBAAA,KAAA,mBAAY;GAAC,CAAA,CAAC,CAC5C,YAAY;;IAAW,QAAA,0BAAA,uBAAA,WAAA,QAAA,CAAQ,aAAA,QAAA,2BAAA,KAAA,IAAA,KAAA,IAAA,uBAAA,KAAA,oBAAU;GAAC,CAAA,CAAC,CAC3C,cAAc;IACb,eAAe,KAAK;GACtB,CAAC;EACL;EACA,OAAO,cAAc,KAAA,KAAA,GAAYC,oCAAAA,4BAAAA,CAA4B,OAAO;CACtE,GAAG,CAAC,MAAM,QAAQ,WAAW,CAAC;CAE9B,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,qBAAD;EAAqB,GAAI;EACvB,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,qBAAD;GAAqB,OAAO;GAAc;EAA8B,CAAA;CACrD,CAAA;AAEzB"}
@@ -1,7 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { PersistQueryClientOptions } from "@tanstack/query-persist-client-core";
3
3
  import { OmitKeyof, QueryClientProviderProps } from "@tanstack/react-query";
4
- //#region src/PersistQueryClientProvider.d.ts
5
4
  /**
6
5
  * The props of `PersistQueryClientProvider`: the props of `QueryClientProvider`, plus the
7
6
  * `persistOptions` and callbacks for when restoring succeeds or fails.
@@ -22,5 +21,4 @@ export type PersistQueryClientProviderProps = QueryClientProviderProps & {
22
21
  * @returns The `QueryClientProvider` wrapping the children.
23
22
  */
24
23
  export declare const PersistQueryClientProvider: ({ children, persistOptions, onSuccess, onError, ...props }: PersistQueryClientProviderProps) => React.JSX.Element;
25
- //#endregion
26
24
  //# sourceMappingURL=PersistQueryClientProvider.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PersistQueryClientProvider.d.cts","names":[],"sources":["../../src/PersistQueryClientProvider.tsx"],"mappings":";;;;;;;;YAeY,kCAAkC;EAC5C,gBAAgB,UAAU;EAC1B,kBAAkB;EAClB,gBAAgB;;;;;;;;;;;;qBAaL,+BAA8B,UAAA,gBAAA,WAAA,YAAA,SAMxC,oCAAkC,MAAM,IAAI"}
1
+ {"version":3,"file":"PersistQueryClientProvider.d.cts","names":[],"sources":["../../src/PersistQueryClientProvider.tsx"],"mappings":";;;;;;;YAeY,kCAAkC;EAC5C,gBAAgB,UAAU;EAC1B,kBAAkB;EAClB,gBAAgB;;;;;;;;;;;;qBAaL,+BAA8B,UAAA,gBAAA,WAAA,YAAA,SAMxC,oCAAkC,MAAM,IAAI"}
@@ -1,7 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { PersistQueryClientOptions } from "@tanstack/query-persist-client-core";
3
3
  import { OmitKeyof, QueryClientProviderProps } from "@tanstack/react-query";
4
- //#region src/PersistQueryClientProvider.d.ts
5
4
  /**
6
5
  * The props of `PersistQueryClientProvider`: the props of `QueryClientProvider`, plus the
7
6
  * `persistOptions` and callbacks for when restoring succeeds or fails.
@@ -22,5 +21,4 @@ export type PersistQueryClientProviderProps = QueryClientProviderProps & {
22
21
  * @returns The `QueryClientProvider` wrapping the children.
23
22
  */
24
23
  export declare const PersistQueryClientProvider: ({ children, persistOptions, onSuccess, onError, ...props }: PersistQueryClientProviderProps) => React.JSX.Element;
25
- //#endregion
26
24
  //# sourceMappingURL=PersistQueryClientProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PersistQueryClientProvider.d.ts","names":[],"sources":["../../src/PersistQueryClientProvider.tsx"],"mappings":";;;;;;;;YAeY,kCAAkC;EAC5C,gBAAgB,UAAU;EAC1B,kBAAkB;EAClB,gBAAgB;;;;;;;;;;;;qBAaL,+BAA8B,UAAA,gBAAA,WAAA,YAAA,SAMxC,oCAAkC,MAAM,IAAI"}
1
+ {"version":3,"file":"PersistQueryClientProvider.d.ts","names":[],"sources":["../../src/PersistQueryClientProvider.tsx"],"mappings":";;;;;;;YAeY,kCAAkC;EAC5C,gBAAgB,UAAU;EAC1B,kBAAkB;EAClB,gBAAgB;;;;;;;;;;;;qBAaL,+BAA8B,UAAA,gBAAA,WAAA,YAAA,SAMxC,oCAAkC,MAAM,IAAI"}
@@ -3,7 +3,7 @@ import * as React from "react";
3
3
  import { persistQueryClientRestore, persistQueryClientSubscribe } from "@tanstack/query-persist-client-core";
4
4
  import { IsRestoringProvider, QueryClientProvider } from "@tanstack/react-query";
5
5
  import { jsx } from "react/jsx-runtime";
6
- //#region src/PersistQueryClientProvider.tsx
6
+ // src/PersistQueryClientProvider.tsx
7
7
  /**
8
8
  * Provides the `QueryClient` like `QueryClientProvider`, and restores the persisted client first:
9
9
  * while restoring, `useIsRestoring` returns `true` and queries wait for the restore to finish
@@ -56,7 +56,6 @@ const PersistQueryClientProvider = ({ children, persistOptions, onSuccess, onErr
56
56
  })
57
57
  });
58
58
  };
59
- //#endregion
60
59
  export { PersistQueryClientProvider };
61
60
 
62
61
  //# sourceMappingURL=PersistQueryClientProvider.js.map
@@ -1,3 +1,2 @@
1
- import { PersistQueryClientProvider } from "./PersistQueryClientProvider.js";
1
+ export { PersistQueryClientProvider } from "./PersistQueryClientProvider.js";
2
2
  export * from "@tanstack/query-persist-client-core";
3
- export { PersistQueryClientProvider };
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- //#region \0rolldown/runtime.js
3
+ // \0rolldown/runtime.js
4
4
  var __create = Object.create;
5
5
  var __defProp = Object.defineProperty;
6
6
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -21,13 +21,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
21
  value: mod,
22
22
  enumerable: true
23
23
  }) : target, mod));
24
- //#endregion
25
24
  let react = require("react");
26
25
  react = __toESM(react, 1);
27
26
  let _tanstack_query_persist_client_core = require("@tanstack/query-persist-client-core");
28
27
  let _tanstack_react_query = require("@tanstack/react-query");
29
28
  let react_jsx_runtime = require("react/jsx-runtime");
30
- //#region src/PersistQueryClientProvider.tsx
29
+ // src/PersistQueryClientProvider.tsx
31
30
  /**
32
31
  * Provides the `QueryClient` like `QueryClientProvider`, and restores the persisted client first:
33
32
  * while restoring, `useIsRestoring` returns `true` and queries wait for the restore to finish
@@ -74,7 +73,6 @@ const PersistQueryClientProvider = ({ children, persistOptions, onSuccess, onErr
74
73
  })
75
74
  });
76
75
  };
77
- //#endregion
78
76
  exports.PersistQueryClientProvider = PersistQueryClientProvider;
79
77
 
80
78
  //# sourceMappingURL=PersistQueryClientProvider.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"PersistQueryClientProvider.cjs","names":["React","persistQueryClientSubscribe","QueryClientProvider","IsRestoringProvider"],"sources":["../../src/PersistQueryClientProvider.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport {\n persistQueryClientRestore,\n persistQueryClientSubscribe,\n} from '@tanstack/query-persist-client-core'\nimport { IsRestoringProvider, QueryClientProvider } from '@tanstack/react-query'\nimport type { PersistQueryClientOptions } from '@tanstack/query-persist-client-core'\nimport type { OmitKeyof, QueryClientProviderProps } from '@tanstack/react-query'\n\n/**\n * The props of `PersistQueryClientProvider`: the props of `QueryClientProvider`, plus the\n * `persistOptions` and callbacks for when restoring succeeds or fails.\n */\nexport type PersistQueryClientProviderProps = QueryClientProviderProps & {\n persistOptions: OmitKeyof<PersistQueryClientOptions, 'queryClient'>\n onSuccess?: () => Promise<unknown> | unknown\n onError?: () => Promise<unknown> | unknown\n}\n\n/**\n * Provides the `QueryClient` like `QueryClientProvider`, and restores the persisted client first:\n * while restoring, `useIsRestoring` returns `true` and queries wait for the restore to finish\n * before subscribing. Once restored, the client is saved with the persister whenever the cache\n * changes.\n * @param props - The `QueryClientProvider` props, the `persistOptions`, and the `onSuccess` and\n * `onError` callbacks. `onSuccess` is called once restoring finishes, even if nothing was restored\n * (e.g. because the persisted client expired), and `onError` if restoring or `onSuccess` throws.\n * @returns The `QueryClientProvider` wrapping the children.\n */\nexport const PersistQueryClientProvider = ({\n children,\n persistOptions,\n onSuccess,\n onError,\n ...props\n}: PersistQueryClientProviderProps): React.JSX.Element => {\n const [isRestoring, setIsRestoring] = React.useState(true)\n const optionsRef = React.useRef({ persistOptions, onSuccess, onError })\n const didRestoreRef = React.useRef(false)\n\n React.useEffect(() => {\n optionsRef.current = { persistOptions, onSuccess, onError }\n })\n\n React.useEffect(() => {\n const options = {\n ...optionsRef.current.persistOptions,\n queryClient: props.client,\n }\n if (!didRestoreRef.current) {\n didRestoreRef.current = true\n persistQueryClientRestore(options)\n .then(() => optionsRef.current.onSuccess?.())\n .catch(() => optionsRef.current.onError?.())\n .finally(() => {\n setIsRestoring(false)\n })\n }\n return isRestoring ? undefined : persistQueryClientSubscribe(options)\n }, [props.client, isRestoring])\n\n return (\n <QueryClientProvider {...props}>\n <IsRestoringProvider value={isRestoring}>{children}</IsRestoringProvider>\n </QueryClientProvider>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAa,8BAA8B,EACzC,UACA,gBACA,WACA,SACA,GAAG,YACqD;CACxD,MAAM,CAAC,aAAa,kBAAkBA,MAAM,SAAS,IAAI;CACzD,MAAM,aAAaA,MAAM,OAAO;EAAE;EAAgB;EAAW;CAAQ,CAAC;CACtE,MAAM,gBAAgBA,MAAM,OAAO,KAAK;CAExC,MAAM,gBAAgB;EACpB,WAAW,UAAU;GAAE;GAAgB;GAAW;EAAQ;CAC5D,CAAC;CAED,MAAM,gBAAgB;EACpB,MAAM,UAAU;GACd,GAAG,WAAW,QAAQ;GACtB,aAAa,MAAM;EACrB;EACA,IAAI,CAAC,cAAc,SAAS;GAC1B,cAAc,UAAU;GACxB,CAAA,GAAA,oCAAA,0BAAA,CAA0B,OAAO,CAAC,CAC/B,WAAW,WAAW,QAAQ,YAAY,CAAC,CAAC,CAC5C,YAAY,WAAW,QAAQ,UAAU,CAAC,CAAC,CAC3C,cAAc;IACb,eAAe,KAAK;GACtB,CAAC;EACL;EACA,OAAO,cAAc,KAAA,KAAA,GAAYC,oCAAAA,4BAAAA,CAA4B,OAAO;CACtE,GAAG,CAAC,MAAM,QAAQ,WAAW,CAAC;CAE9B,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,qBAAD;EAAqB,GAAI;EACvB,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,qBAAD;GAAqB,OAAO;GAAc;EAA8B,CAAA;CACrD,CAAA;AAEzB"}
1
+ {"version":3,"file":"PersistQueryClientProvider.cjs","names":["React","persistQueryClientSubscribe","QueryClientProvider","IsRestoringProvider"],"sources":["../../src/PersistQueryClientProvider.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport {\n persistQueryClientRestore,\n persistQueryClientSubscribe,\n} from '@tanstack/query-persist-client-core'\nimport { IsRestoringProvider, QueryClientProvider } from '@tanstack/react-query'\nimport type { PersistQueryClientOptions } from '@tanstack/query-persist-client-core'\nimport type { OmitKeyof, QueryClientProviderProps } from '@tanstack/react-query'\n\n/**\n * The props of `PersistQueryClientProvider`: the props of `QueryClientProvider`, plus the\n * `persistOptions` and callbacks for when restoring succeeds or fails.\n */\nexport type PersistQueryClientProviderProps = QueryClientProviderProps & {\n persistOptions: OmitKeyof<PersistQueryClientOptions, 'queryClient'>\n onSuccess?: () => Promise<unknown> | unknown\n onError?: () => Promise<unknown> | unknown\n}\n\n/**\n * Provides the `QueryClient` like `QueryClientProvider`, and restores the persisted client first:\n * while restoring, `useIsRestoring` returns `true` and queries wait for the restore to finish\n * before subscribing. Once restored, the client is saved with the persister whenever the cache\n * changes.\n * @param props - The `QueryClientProvider` props, the `persistOptions`, and the `onSuccess` and\n * `onError` callbacks. `onSuccess` is called once restoring finishes, even if nothing was restored\n * (e.g. because the persisted client expired), and `onError` if restoring or `onSuccess` throws.\n * @returns The `QueryClientProvider` wrapping the children.\n */\nexport const PersistQueryClientProvider = ({\n children,\n persistOptions,\n onSuccess,\n onError,\n ...props\n}: PersistQueryClientProviderProps): React.JSX.Element => {\n const [isRestoring, setIsRestoring] = React.useState(true)\n const optionsRef = React.useRef({ persistOptions, onSuccess, onError })\n const didRestoreRef = React.useRef(false)\n\n React.useEffect(() => {\n optionsRef.current = { persistOptions, onSuccess, onError }\n })\n\n React.useEffect(() => {\n const options = {\n ...optionsRef.current.persistOptions,\n queryClient: props.client,\n }\n if (!didRestoreRef.current) {\n didRestoreRef.current = true\n persistQueryClientRestore(options)\n .then(() => optionsRef.current.onSuccess?.())\n .catch(() => optionsRef.current.onError?.())\n .finally(() => {\n setIsRestoring(false)\n })\n }\n return isRestoring ? undefined : persistQueryClientSubscribe(options)\n }, [props.client, isRestoring])\n\n return (\n <QueryClientProvider {...props}>\n <IsRestoringProvider value={isRestoring}>{children}</IsRestoringProvider>\n </QueryClientProvider>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAa,8BAA8B,EACzC,UACA,gBACA,WACA,SACA,GAAG,YACqD;CACxD,MAAM,CAAC,aAAa,kBAAkBA,MAAM,SAAS,IAAI;CACzD,MAAM,aAAaA,MAAM,OAAO;EAAE;EAAgB;EAAW;CAAQ,CAAC;CACtE,MAAM,gBAAgBA,MAAM,OAAO,KAAK;CAExC,MAAM,gBAAgB;EACpB,WAAW,UAAU;GAAE;GAAgB;GAAW;EAAQ;CAC5D,CAAC;CAED,MAAM,gBAAgB;EACpB,MAAM,UAAU;GACd,GAAG,WAAW,QAAQ;GACtB,aAAa,MAAM;EACrB;EACA,IAAI,CAAC,cAAc,SAAS;GAC1B,cAAc,UAAU;GACxB,CAAA,GAAA,oCAAA,0BAAA,CAA0B,OAAO,CAAC,CAC/B,WAAW,WAAW,QAAQ,YAAY,CAAC,CAAC,CAC5C,YAAY,WAAW,QAAQ,UAAU,CAAC,CAAC,CAC3C,cAAc;IACb,eAAe,KAAK;GACtB,CAAC;EACL;EACA,OAAO,cAAc,KAAA,KAAA,GAAYC,oCAAAA,4BAAAA,CAA4B,OAAO;CACtE,GAAG,CAAC,MAAM,QAAQ,WAAW,CAAC;CAE9B,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,qBAAD;EAAqB,GAAI;EACvB,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,qBAAD;GAAqB,OAAO;GAAc;EAA8B,CAAA;CACrD,CAAA;AAEzB"}
@@ -1,7 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { PersistQueryClientOptions } from "@tanstack/query-persist-client-core";
3
3
  import { OmitKeyof, QueryClientProviderProps } from "@tanstack/react-query";
4
- //#region src/PersistQueryClientProvider.d.ts
5
4
  /**
6
5
  * The props of `PersistQueryClientProvider`: the props of `QueryClientProvider`, plus the
7
6
  * `persistOptions` and callbacks for when restoring succeeds or fails.
@@ -22,5 +21,4 @@ export type PersistQueryClientProviderProps = QueryClientProviderProps & {
22
21
  * @returns The `QueryClientProvider` wrapping the children.
23
22
  */
24
23
  export declare const PersistQueryClientProvider: ({ children, persistOptions, onSuccess, onError, ...props }: PersistQueryClientProviderProps) => React.JSX.Element;
25
- //#endregion
26
24
  //# sourceMappingURL=PersistQueryClientProvider.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PersistQueryClientProvider.d.cts","names":[],"sources":["../../src/PersistQueryClientProvider.tsx"],"mappings":";;;;;;;;YAeY,kCAAkC;EAC5C,gBAAgB,UAAU;EAC1B,kBAAkB;EAClB,gBAAgB;;;;;;;;;;;;qBAaL,+BAA8B,UAAA,gBAAA,WAAA,YAAA,SAMxC,oCAAkC,MAAM,IAAI"}
1
+ {"version":3,"file":"PersistQueryClientProvider.d.cts","names":[],"sources":["../../src/PersistQueryClientProvider.tsx"],"mappings":";;;;;;;YAeY,kCAAkC;EAC5C,gBAAgB,UAAU;EAC1B,kBAAkB;EAClB,gBAAgB;;;;;;;;;;;;qBAaL,+BAA8B,UAAA,gBAAA,WAAA,YAAA,SAMxC,oCAAkC,MAAM,IAAI"}
@@ -1,7 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { PersistQueryClientOptions } from "@tanstack/query-persist-client-core";
3
3
  import { OmitKeyof, QueryClientProviderProps } from "@tanstack/react-query";
4
- //#region src/PersistQueryClientProvider.d.ts
5
4
  /**
6
5
  * The props of `PersistQueryClientProvider`: the props of `QueryClientProvider`, plus the
7
6
  * `persistOptions` and callbacks for when restoring succeeds or fails.
@@ -22,5 +21,4 @@ export type PersistQueryClientProviderProps = QueryClientProviderProps & {
22
21
  * @returns The `QueryClientProvider` wrapping the children.
23
22
  */
24
23
  export declare const PersistQueryClientProvider: ({ children, persistOptions, onSuccess, onError, ...props }: PersistQueryClientProviderProps) => React.JSX.Element;
25
- //#endregion
26
24
  //# sourceMappingURL=PersistQueryClientProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PersistQueryClientProvider.d.ts","names":[],"sources":["../../src/PersistQueryClientProvider.tsx"],"mappings":";;;;;;;;YAeY,kCAAkC;EAC5C,gBAAgB,UAAU;EAC1B,kBAAkB;EAClB,gBAAgB;;;;;;;;;;;;qBAaL,+BAA8B,UAAA,gBAAA,WAAA,YAAA,SAMxC,oCAAkC,MAAM,IAAI"}
1
+ {"version":3,"file":"PersistQueryClientProvider.d.ts","names":[],"sources":["../../src/PersistQueryClientProvider.tsx"],"mappings":";;;;;;;YAeY,kCAAkC;EAC5C,gBAAgB,UAAU;EAC1B,kBAAkB;EAClB,gBAAgB;;;;;;;;;;;;qBAaL,+BAA8B,UAAA,gBAAA,WAAA,YAAA,SAMxC,oCAAkC,MAAM,IAAI"}
@@ -3,7 +3,7 @@ import * as React from "react";
3
3
  import { persistQueryClientRestore, persistQueryClientSubscribe } from "@tanstack/query-persist-client-core";
4
4
  import { IsRestoringProvider, QueryClientProvider } from "@tanstack/react-query";
5
5
  import { jsx } from "react/jsx-runtime";
6
- //#region src/PersistQueryClientProvider.tsx
6
+ // src/PersistQueryClientProvider.tsx
7
7
  /**
8
8
  * Provides the `QueryClient` like `QueryClientProvider`, and restores the persisted client first:
9
9
  * while restoring, `useIsRestoring` returns `true` and queries wait for the restore to finish
@@ -50,7 +50,6 @@ const PersistQueryClientProvider = ({ children, persistOptions, onSuccess, onErr
50
50
  })
51
51
  });
52
52
  };
53
- //#endregion
54
53
  export { PersistQueryClientProvider };
55
54
 
56
55
  //# sourceMappingURL=PersistQueryClientProvider.js.map
@@ -1,3 +1,2 @@
1
- import { PersistQueryClientProvider } from "./PersistQueryClientProvider.js";
1
+ export { PersistQueryClientProvider } from "./PersistQueryClientProvider.js";
2
2
  export * from "@tanstack/query-persist-client-core";
3
- export { PersistQueryClientProvider };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/react-query-persist-client",
3
- "version": "5.105.0",
3
+ "version": "5.105.1",
4
4
  "description": "React bindings to work with persisters in TanStack/react-query",
5
5
  "author": "tannerlinsley",
6
6
  "license": "MIT",
@@ -40,21 +40,21 @@
40
40
  "!src/__tests__"
41
41
  ],
42
42
  "dependencies": {
43
- "@tanstack/query-persist-client-core": "5.105.0"
43
+ "@tanstack/query-persist-client-core": "5.105.1"
44
44
  },
45
45
  "devDependencies": {
46
- "@eslint-react/eslint-plugin": "^5.23.3",
46
+ "@eslint-react/eslint-plugin": "^5.28.8",
47
47
  "@tanstack/query-test-utils": "0.0.0",
48
- "@tanstack/react-query": "5.105.0",
48
+ "@tanstack/react-query": "5.105.1",
49
49
  "@testing-library/react": "^16.1.0",
50
- "@types/react": "^19.2.7",
50
+ "@types/react": "^19.3.0",
51
51
  "@vitejs/plugin-react": "^6.1.1",
52
52
  "eslint-plugin-react-hooks": "^7.1.1",
53
- "react": "^19.2.1",
53
+ "react": "^19.3.1",
54
54
  "typescript": "6.0.3"
55
55
  },
56
56
  "peerDependencies": {
57
- "@tanstack/react-query": "^5.105.0",
57
+ "@tanstack/react-query": "^5.105.1",
58
58
  "@types/react": "^18 || ^19",
59
59
  "react": "^18 || ^19"
60
60
  },