@tanstack/react-query-persist-client 5.101.4 → 5.102.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.
- package/build/legacy/PersistQueryClientProvider.cjs +65 -68
- package/build/legacy/PersistQueryClientProvider.cjs.map +1 -1
- package/build/legacy/PersistQueryClientProvider.d.cts +13 -2
- package/build/legacy/PersistQueryClientProvider.d.cts.map +1 -0
- package/build/legacy/PersistQueryClientProvider.d.ts +13 -2
- package/build/legacy/PersistQueryClientProvider.d.ts.map +1 -0
- package/build/legacy/PersistQueryClientProvider.js +46 -42
- package/build/legacy/PersistQueryClientProvider.js.map +1 -1
- package/build/legacy/index.cjs +11 -26
- package/build/legacy/index.d.cts +3 -21
- package/build/legacy/index.d.ts +3 -21
- package/build/legacy/index.js +2 -3
- package/build/modern/PersistQueryClientProvider.cjs +59 -62
- package/build/modern/PersistQueryClientProvider.cjs.map +1 -1
- package/build/modern/PersistQueryClientProvider.d.cts +13 -2
- package/build/modern/PersistQueryClientProvider.d.cts.map +1 -0
- package/build/modern/PersistQueryClientProvider.d.ts +13 -2
- package/build/modern/PersistQueryClientProvider.d.ts.map +1 -0
- package/build/modern/PersistQueryClientProvider.js +40 -36
- package/build/modern/PersistQueryClientProvider.js.map +1 -1
- package/build/modern/index.cjs +11 -26
- package/build/modern/index.d.cts +3 -21
- package/build/modern/index.d.ts +3 -21
- package/build/modern/index.js +2 -3
- package/package.json +6 -8
- package/build/legacy/_tsup-dts-rollup.d.cts +0 -74
- package/build/legacy/_tsup-dts-rollup.d.ts +0 -74
- package/build/legacy/index.cjs.map +0 -1
- package/build/legacy/index.js.map +0 -1
- package/build/modern/_tsup-dts-rollup.d.cts +0 -74
- package/build/modern/_tsup-dts-rollup.d.ts +0 -74
- package/build/modern/index.cjs.map +0 -1
- package/build/modern/index.js.map +0 -1
|
@@ -1,79 +1,76 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
"use client";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
//#region \0rolldown/runtime.js
|
|
3
4
|
var __create = Object.create;
|
|
4
5
|
var __defProp = Object.defineProperty;
|
|
5
6
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
7
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __export = (target, all) => {
|
|
10
|
-
for (var name in all)
|
|
11
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
-
};
|
|
13
10
|
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
|
+
key = keys[i];
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
|
+
get: ((k) => from[k]).bind(null, key),
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
20
19
|
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_query.QueryClientProvider, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_query.IsRestoringProvider, { value: isRestoring, children }) });
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
21
|
+
value: mod,
|
|
22
|
+
enumerable: true
|
|
23
|
+
}) : target, mod));
|
|
24
|
+
//#endregion
|
|
25
|
+
let react = require("react");
|
|
26
|
+
react = __toESM(react, 1);
|
|
27
|
+
let _tanstack_query_persist_client_core = require("@tanstack/query-persist-client-core");
|
|
28
|
+
let _tanstack_react_query = require("@tanstack/react-query");
|
|
29
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
30
|
+
//#region src/PersistQueryClientProvider.tsx
|
|
31
|
+
const PersistQueryClientProvider = ({ children, persistOptions, onSuccess, onError, ...props }) => {
|
|
32
|
+
const [isRestoring, setIsRestoring] = react.useState(true);
|
|
33
|
+
const refs = react.useRef({
|
|
34
|
+
persistOptions,
|
|
35
|
+
onSuccess,
|
|
36
|
+
onError
|
|
37
|
+
});
|
|
38
|
+
const didRestore = react.useRef(false);
|
|
39
|
+
react.useEffect(() => {
|
|
40
|
+
refs.current = {
|
|
41
|
+
persistOptions,
|
|
42
|
+
onSuccess,
|
|
43
|
+
onError
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
react.useEffect(() => {
|
|
47
|
+
const options = {
|
|
48
|
+
...refs.current.persistOptions,
|
|
49
|
+
queryClient: props.client
|
|
50
|
+
};
|
|
51
|
+
if (!didRestore.current) {
|
|
52
|
+
didRestore.current = true;
|
|
53
|
+
(0, _tanstack_query_persist_client_core.persistQueryClientRestore)(options).then(() => {
|
|
54
|
+
var _refs$current$onSucce, _refs$current;
|
|
55
|
+
return (_refs$current$onSucce = (_refs$current = refs.current).onSuccess) === null || _refs$current$onSucce === void 0 ? void 0 : _refs$current$onSucce.call(_refs$current);
|
|
56
|
+
}).catch(() => {
|
|
57
|
+
var _refs$current$onError, _refs$current2;
|
|
58
|
+
return (_refs$current$onError = (_refs$current2 = refs.current).onError) === null || _refs$current$onError === void 0 ? void 0 : _refs$current$onError.call(_refs$current2);
|
|
59
|
+
}).finally(() => {
|
|
60
|
+
setIsRestoring(false);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
return isRestoring ? void 0 : (0, _tanstack_query_persist_client_core.persistQueryClientSubscribe)(options);
|
|
64
|
+
}, [props.client, isRestoring]);
|
|
65
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tanstack_react_query.QueryClientProvider, {
|
|
66
|
+
...props,
|
|
67
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tanstack_react_query.IsRestoringProvider, {
|
|
68
|
+
value: isRestoring,
|
|
69
|
+
children
|
|
70
|
+
})
|
|
71
|
+
});
|
|
74
72
|
};
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
});
|
|
73
|
+
//#endregion
|
|
74
|
+
exports.PersistQueryClientProvider = PersistQueryClientProvider;
|
|
75
|
+
|
|
79
76
|
//# sourceMappingURL=PersistQueryClientProvider.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"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\nexport type PersistQueryClientProviderProps = QueryClientProviderProps & {\n persistOptions: OmitKeyof<PersistQueryClientOptions, 'queryClient'>\n onSuccess?: () => Promise<unknown> | unknown\n onError?: () => Promise<unknown> | unknown\n}\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 refs = React.useRef({ persistOptions, onSuccess, onError })\n const didRestore = React.useRef(false)\n\n React.useEffect(() => {\n refs.current = { persistOptions, onSuccess, onError }\n })\n\n React.useEffect(() => {\n const options = {\n ...refs.current.persistOptions,\n queryClient: props.client,\n }\n if (!didRestore.current) {\n didRestore.current = true\n persistQueryClientRestore(options)\n .then(() => refs.current.onSuccess?.())\n .catch(() => refs.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":"
|
|
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\nexport type PersistQueryClientProviderProps = QueryClientProviderProps & {\n persistOptions: OmitKeyof<PersistQueryClientOptions, 'queryClient'>\n onSuccess?: () => Promise<unknown> | unknown\n onError?: () => Promise<unknown> | unknown\n}\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 refs = React.useRef({ persistOptions, onSuccess, onError })\n const didRestore = React.useRef(false)\n\n React.useEffect(() => {\n refs.current = { persistOptions, onSuccess, onError }\n })\n\n React.useEffect(() => {\n const options = {\n ...refs.current.persistOptions,\n queryClient: props.client,\n }\n if (!didRestore.current) {\n didRestore.current = true\n persistQueryClientRestore(options)\n .then(() => refs.current.onSuccess?.())\n .catch(() => refs.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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,MAAa,8BAA8B,EACzC,UACA,gBACA,WACA,SACA,GAAG,YACqD;CACxD,MAAM,CAAC,aAAa,kBAAkBA,MAAM,SAAS,IAAI;CACzD,MAAM,OAAOA,MAAM,OAAO;EAAE;EAAgB;EAAW;CAAQ,CAAC;CAChE,MAAM,aAAaA,MAAM,OAAO,KAAK;CAErC,MAAM,gBAAgB;EACpB,KAAK,UAAU;GAAE;GAAgB;GAAW;EAAQ;CACtD,CAAC;CAED,MAAM,gBAAgB;EACpB,MAAM,UAAU;GACd,GAAG,KAAK,QAAQ;GAChB,aAAa,MAAM;EACrB;EACA,IAAI,CAAC,WAAW,SAAS;GACvB,WAAW,UAAU;GACrB,CAAA,GAAA,oCAAA,0BAAA,CAA0B,OAAO,CAAC,CAC/B,WAAW;;IAAK,QAAA,yBAAA,gBAAA,KAAA,QAAA,CAAQ,eAAA,QAAA,0BAAA,KAAA,IAAA,KAAA,IAAA,sBAAA,KAAA,aAAY;GAAC,CAAA,CAAC,CACtC,YAAY;;IAAK,QAAA,yBAAA,iBAAA,KAAA,QAAA,CAAQ,aAAA,QAAA,0BAAA,KAAA,IAAA,KAAA,IAAA,sBAAA,KAAA,cAAU;GAAC,CAAA,CAAC,CACrC,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,2 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { PersistQueryClientOptions } from "@tanstack/query-persist-client-core";
|
|
3
|
+
import { OmitKeyof, QueryClientProviderProps } from "@tanstack/react-query";
|
|
4
|
+
//#region src/PersistQueryClientProvider.d.ts
|
|
5
|
+
type PersistQueryClientProviderProps = QueryClientProviderProps & {
|
|
6
|
+
persistOptions: OmitKeyof<PersistQueryClientOptions, 'queryClient'>;
|
|
7
|
+
onSuccess?: () => Promise<unknown> | unknown;
|
|
8
|
+
onError?: () => Promise<unknown> | unknown;
|
|
9
|
+
};
|
|
10
|
+
declare const PersistQueryClientProvider: ({ children, persistOptions, onSuccess, onError, ...props }: PersistQueryClientProviderProps) => React.JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { PersistQueryClientProvider, PersistQueryClientProviderProps };
|
|
13
|
+
//# sourceMappingURL=PersistQueryClientProvider.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PersistQueryClientProvider.d.cts","names":[],"sources":["../../src/PersistQueryClientProvider.tsx"],"mappings":";;;;KAWY,kCAAkC;EAC5C,gBAAgB,UAAU;EAC1B,kBAAkB;EAClB,gBAAgB;;cAGL,+BAA8B,UAAA,gBAAA,WAAA,YAAA,SAMxC,oCAAkC,MAAM,IAAI"}
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { PersistQueryClientOptions } from "@tanstack/query-persist-client-core";
|
|
3
|
+
import { OmitKeyof, QueryClientProviderProps } from "@tanstack/react-query";
|
|
4
|
+
//#region src/PersistQueryClientProvider.d.ts
|
|
5
|
+
type PersistQueryClientProviderProps = QueryClientProviderProps & {
|
|
6
|
+
persistOptions: OmitKeyof<PersistQueryClientOptions, 'queryClient'>;
|
|
7
|
+
onSuccess?: () => Promise<unknown> | unknown;
|
|
8
|
+
onError?: () => Promise<unknown> | unknown;
|
|
9
|
+
};
|
|
10
|
+
declare const PersistQueryClientProvider: ({ children, persistOptions, onSuccess, onError, ...props }: PersistQueryClientProviderProps) => React.JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { PersistQueryClientProvider, PersistQueryClientProviderProps };
|
|
13
|
+
//# sourceMappingURL=PersistQueryClientProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PersistQueryClientProvider.d.ts","names":[],"sources":["../../src/PersistQueryClientProvider.tsx"],"mappings":";;;;KAWY,kCAAkC;EAC5C,gBAAgB,UAAU;EAC1B,kBAAkB;EAClB,gBAAgB;;cAGL,+BAA8B,UAAA,gBAAA,WAAA,YAAA,SAMxC,oCAAkC,MAAM,IAAI"}
|
|
@@ -1,48 +1,52 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
// src/PersistQueryClientProvider.tsx
|
|
4
2
|
import * as React from "react";
|
|
5
|
-
import {
|
|
6
|
-
persistQueryClientRestore,
|
|
7
|
-
persistQueryClientSubscribe
|
|
8
|
-
} from "@tanstack/query-persist-client-core";
|
|
3
|
+
import { persistQueryClientRestore, persistQueryClientSubscribe } from "@tanstack/query-persist-client-core";
|
|
9
4
|
import { IsRestoringProvider, QueryClientProvider } from "@tanstack/react-query";
|
|
10
5
|
import { jsx } from "react/jsx-runtime";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
6
|
+
//#region src/PersistQueryClientProvider.tsx
|
|
7
|
+
const PersistQueryClientProvider = ({ children, persistOptions, onSuccess, onError, ...props }) => {
|
|
8
|
+
const [isRestoring, setIsRestoring] = React.useState(true);
|
|
9
|
+
const refs = React.useRef({
|
|
10
|
+
persistOptions,
|
|
11
|
+
onSuccess,
|
|
12
|
+
onError
|
|
13
|
+
});
|
|
14
|
+
const didRestore = React.useRef(false);
|
|
15
|
+
React.useEffect(() => {
|
|
16
|
+
refs.current = {
|
|
17
|
+
persistOptions,
|
|
18
|
+
onSuccess,
|
|
19
|
+
onError
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
React.useEffect(() => {
|
|
23
|
+
const options = {
|
|
24
|
+
...refs.current.persistOptions,
|
|
25
|
+
queryClient: props.client
|
|
26
|
+
};
|
|
27
|
+
if (!didRestore.current) {
|
|
28
|
+
didRestore.current = true;
|
|
29
|
+
persistQueryClientRestore(options).then(() => {
|
|
30
|
+
var _refs$current$onSucce, _refs$current;
|
|
31
|
+
return (_refs$current$onSucce = (_refs$current = refs.current).onSuccess) === null || _refs$current$onSucce === void 0 ? void 0 : _refs$current$onSucce.call(_refs$current);
|
|
32
|
+
}).catch(() => {
|
|
33
|
+
var _refs$current$onError, _refs$current2;
|
|
34
|
+
return (_refs$current$onError = (_refs$current2 = refs.current).onError) === null || _refs$current$onError === void 0 ? void 0 : _refs$current$onError.call(_refs$current2);
|
|
35
|
+
}).finally(() => {
|
|
36
|
+
setIsRestoring(false);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return isRestoring ? void 0 : persistQueryClientSubscribe(options);
|
|
40
|
+
}, [props.client, isRestoring]);
|
|
41
|
+
return /* @__PURE__ */ jsx(QueryClientProvider, {
|
|
42
|
+
...props,
|
|
43
|
+
children: /* @__PURE__ */ jsx(IsRestoringProvider, {
|
|
44
|
+
value: isRestoring,
|
|
45
|
+
children
|
|
46
|
+
})
|
|
47
|
+
});
|
|
47
48
|
};
|
|
49
|
+
//#endregion
|
|
50
|
+
export { PersistQueryClientProvider };
|
|
51
|
+
|
|
48
52
|
//# sourceMappingURL=PersistQueryClientProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"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\nexport type PersistQueryClientProviderProps = QueryClientProviderProps & {\n persistOptions: OmitKeyof<PersistQueryClientOptions, 'queryClient'>\n onSuccess?: () => Promise<unknown> | unknown\n onError?: () => Promise<unknown> | unknown\n}\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 refs = React.useRef({ persistOptions, onSuccess, onError })\n const didRestore = React.useRef(false)\n\n React.useEffect(() => {\n refs.current = { persistOptions, onSuccess, onError }\n })\n\n React.useEffect(() => {\n const options = {\n ...refs.current.persistOptions,\n queryClient: props.client,\n }\n if (!didRestore.current) {\n didRestore.current = true\n persistQueryClientRestore(options)\n .then(() => refs.current.onSuccess?.())\n .catch(() => refs.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":"
|
|
1
|
+
{"version":3,"file":"PersistQueryClientProvider.js","names":[],"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\nexport type PersistQueryClientProviderProps = QueryClientProviderProps & {\n persistOptions: OmitKeyof<PersistQueryClientOptions, 'queryClient'>\n onSuccess?: () => Promise<unknown> | unknown\n onError?: () => Promise<unknown> | unknown\n}\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 refs = React.useRef({ persistOptions, onSuccess, onError })\n const didRestore = React.useRef(false)\n\n React.useEffect(() => {\n refs.current = { persistOptions, onSuccess, onError }\n })\n\n React.useEffect(() => {\n const options = {\n ...refs.current.persistOptions,\n queryClient: props.client,\n }\n if (!didRestore.current) {\n didRestore.current = true\n persistQueryClientRestore(options)\n .then(() => refs.current.onSuccess?.())\n .catch(() => refs.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":";;;;;;AAiBA,MAAa,8BAA8B,EACzC,UACA,gBACA,WACA,SACA,GAAG,YACqD;CACxD,MAAM,CAAC,aAAa,kBAAkB,MAAM,SAAS,IAAI;CACzD,MAAM,OAAO,MAAM,OAAO;EAAE;EAAgB;EAAW;CAAQ,CAAC;CAChE,MAAM,aAAa,MAAM,OAAO,KAAK;CAErC,MAAM,gBAAgB;EACpB,KAAK,UAAU;GAAE;GAAgB;GAAW;EAAQ;CACtD,CAAC;CAED,MAAM,gBAAgB;EACpB,MAAM,UAAU;GACd,GAAG,KAAK,QAAQ;GAChB,aAAa,MAAM;EACrB;EACA,IAAI,CAAC,WAAW,SAAS;GACvB,WAAW,UAAU;GACrB,0BAA0B,OAAO,CAAC,CAC/B,WAAW;;IAAK,QAAA,yBAAA,gBAAA,KAAA,QAAA,CAAQ,eAAA,QAAA,0BAAA,KAAA,IAAA,KAAA,IAAA,sBAAA,KAAA,aAAY;GAAC,CAAA,CAAC,CACtC,YAAY;;IAAK,QAAA,yBAAA,iBAAA,KAAA,QAAA,CAAQ,aAAA,QAAA,0BAAA,KAAA,IAAA,KAAA,IAAA,sBAAA,KAAA,cAAU;GAAC,CAAA,CAAC,CACrC,cAAc;IACb,eAAe,KAAK;GACtB,CAAC;EACL;EACA,OAAO,cAAc,KAAA,IAAY,4BAA4B,OAAO;CACtE,GAAG,CAAC,MAAM,QAAQ,WAAW,CAAC;CAE9B,OACE,oBAAC,qBAAD;EAAqB,GAAI;EACvB,UAAA,oBAAC,qBAAD;GAAqB,OAAO;GAAc;EAA8B,CAAA;CACrD,CAAA;AAEzB"}
|
package/build/legacy/index.cjs
CHANGED
|
@@ -1,27 +1,12 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
-
|
|
17
|
-
// src/index.ts
|
|
18
|
-
var index_exports = {};
|
|
19
|
-
module.exports = __toCommonJS(index_exports);
|
|
20
|
-
__reExport(index_exports, require("@tanstack/query-persist-client-core"), module.exports);
|
|
21
|
-
__reExport(index_exports, require("./PersistQueryClientProvider.cjs"), module.exports);
|
|
22
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
23
|
-
0 && (module.exports = {
|
|
24
|
-
...require("@tanstack/query-persist-client-core"),
|
|
25
|
-
...require("./PersistQueryClientProvider.cjs")
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_PersistQueryClientProvider = require("./PersistQueryClientProvider.cjs");
|
|
3
|
+
exports.PersistQueryClientProvider = require_PersistQueryClientProvider.PersistQueryClientProvider;
|
|
4
|
+
var _tanstack_query_persist_client_core = require("@tanstack/query-persist-client-core");
|
|
5
|
+
Object.keys(_tanstack_query_persist_client_core).forEach(function(k) {
|
|
6
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function() {
|
|
9
|
+
return _tanstack_query_persist_client_core[k];
|
|
10
|
+
}
|
|
11
|
+
});
|
|
26
12
|
});
|
|
27
|
-
//# sourceMappingURL=index.cjs.map
|
package/build/legacy/index.d.cts
CHANGED
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export {
|
|
4
|
-
export { persistQueryClient } from './_tsup-dts-rollup.cjs';
|
|
5
|
-
export { Promisable } from './_tsup-dts-rollup.cjs';
|
|
6
|
-
export { Persister } from './_tsup-dts-rollup.cjs';
|
|
7
|
-
export { PersistedClient } from './_tsup-dts-rollup.cjs';
|
|
8
|
-
export { PersistQueryClientRootOptions } from './_tsup-dts-rollup.cjs';
|
|
9
|
-
export { PersistedQueryClientRestoreOptions } from './_tsup-dts-rollup.cjs';
|
|
10
|
-
export { PersistedQueryClientSaveOptions } from './_tsup-dts-rollup.cjs';
|
|
11
|
-
export { PersistQueryClientOptions } from './_tsup-dts-rollup.cjs';
|
|
12
|
-
export { PersistRetryer } from './_tsup-dts-rollup.cjs';
|
|
13
|
-
export { removeOldestQuery } from './_tsup-dts-rollup.cjs';
|
|
14
|
-
export { experimental_createQueryPersister } from './_tsup-dts-rollup.cjs';
|
|
15
|
-
export { PersistedQuery } from './_tsup-dts-rollup.cjs';
|
|
16
|
-
export { MaybePromise } from './_tsup-dts-rollup.cjs';
|
|
17
|
-
export { AsyncStorage } from './_tsup-dts-rollup.cjs';
|
|
18
|
-
export { StoragePersisterOptions } from './_tsup-dts-rollup.cjs';
|
|
19
|
-
export { PERSISTER_KEY_PREFIX } from './_tsup-dts-rollup.cjs';
|
|
20
|
-
export { PersistQueryClientProviderProps_alias_1 as PersistQueryClientProviderProps } from './_tsup-dts-rollup.cjs';
|
|
21
|
-
export { PersistQueryClientProvider_alias_1 as PersistQueryClientProvider } from './_tsup-dts-rollup.cjs';
|
|
1
|
+
import { PersistQueryClientProvider, PersistQueryClientProviderProps } from "./PersistQueryClientProvider.cjs";
|
|
2
|
+
export * from "@tanstack/query-persist-client-core";
|
|
3
|
+
export { PersistQueryClientProvider, PersistQueryClientProviderProps };
|
package/build/legacy/index.d.ts
CHANGED
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export {
|
|
4
|
-
export { persistQueryClient } from './_tsup-dts-rollup.js';
|
|
5
|
-
export { Promisable } from './_tsup-dts-rollup.js';
|
|
6
|
-
export { Persister } from './_tsup-dts-rollup.js';
|
|
7
|
-
export { PersistedClient } from './_tsup-dts-rollup.js';
|
|
8
|
-
export { PersistQueryClientRootOptions } from './_tsup-dts-rollup.js';
|
|
9
|
-
export { PersistedQueryClientRestoreOptions } from './_tsup-dts-rollup.js';
|
|
10
|
-
export { PersistedQueryClientSaveOptions } from './_tsup-dts-rollup.js';
|
|
11
|
-
export { PersistQueryClientOptions } from './_tsup-dts-rollup.js';
|
|
12
|
-
export { PersistRetryer } from './_tsup-dts-rollup.js';
|
|
13
|
-
export { removeOldestQuery } from './_tsup-dts-rollup.js';
|
|
14
|
-
export { experimental_createQueryPersister } from './_tsup-dts-rollup.js';
|
|
15
|
-
export { PersistedQuery } from './_tsup-dts-rollup.js';
|
|
16
|
-
export { MaybePromise } from './_tsup-dts-rollup.js';
|
|
17
|
-
export { AsyncStorage } from './_tsup-dts-rollup.js';
|
|
18
|
-
export { StoragePersisterOptions } from './_tsup-dts-rollup.js';
|
|
19
|
-
export { PERSISTER_KEY_PREFIX } from './_tsup-dts-rollup.js';
|
|
20
|
-
export { PersistQueryClientProviderProps_alias_1 as PersistQueryClientProviderProps } from './_tsup-dts-rollup.js';
|
|
21
|
-
export { PersistQueryClientProvider_alias_1 as PersistQueryClientProvider } from './_tsup-dts-rollup.js';
|
|
1
|
+
import { PersistQueryClientProvider, PersistQueryClientProviderProps } from "./PersistQueryClientProvider.js";
|
|
2
|
+
export * from "@tanstack/query-persist-client-core";
|
|
3
|
+
export { PersistQueryClientProvider, PersistQueryClientProviderProps };
|
package/build/legacy/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import { PersistQueryClientProvider } from "./PersistQueryClientProvider.js";
|
|
2
2
|
export * from "@tanstack/query-persist-client-core";
|
|
3
|
-
export
|
|
4
|
-
//# sourceMappingURL=index.js.map
|
|
3
|
+
export { PersistQueryClientProvider };
|
|
@@ -1,73 +1,70 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
"use client";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
//#region \0rolldown/runtime.js
|
|
3
4
|
var __create = Object.create;
|
|
4
5
|
var __defProp = Object.defineProperty;
|
|
5
6
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
7
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __export = (target, all) => {
|
|
10
|
-
for (var name in all)
|
|
11
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
-
};
|
|
13
10
|
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
|
+
key = keys[i];
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
|
+
get: ((k) => from[k]).bind(null, key),
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
20
19
|
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_query.QueryClientProvider, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_query.IsRestoringProvider, { value: isRestoring, children }) });
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
21
|
+
value: mod,
|
|
22
|
+
enumerable: true
|
|
23
|
+
}) : target, mod));
|
|
24
|
+
//#endregion
|
|
25
|
+
let react = require("react");
|
|
26
|
+
react = __toESM(react, 1);
|
|
27
|
+
let _tanstack_query_persist_client_core = require("@tanstack/query-persist-client-core");
|
|
28
|
+
let _tanstack_react_query = require("@tanstack/react-query");
|
|
29
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
30
|
+
//#region src/PersistQueryClientProvider.tsx
|
|
31
|
+
const PersistQueryClientProvider = ({ children, persistOptions, onSuccess, onError, ...props }) => {
|
|
32
|
+
const [isRestoring, setIsRestoring] = react.useState(true);
|
|
33
|
+
const refs = react.useRef({
|
|
34
|
+
persistOptions,
|
|
35
|
+
onSuccess,
|
|
36
|
+
onError
|
|
37
|
+
});
|
|
38
|
+
const didRestore = react.useRef(false);
|
|
39
|
+
react.useEffect(() => {
|
|
40
|
+
refs.current = {
|
|
41
|
+
persistOptions,
|
|
42
|
+
onSuccess,
|
|
43
|
+
onError
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
react.useEffect(() => {
|
|
47
|
+
const options = {
|
|
48
|
+
...refs.current.persistOptions,
|
|
49
|
+
queryClient: props.client
|
|
50
|
+
};
|
|
51
|
+
if (!didRestore.current) {
|
|
52
|
+
didRestore.current = true;
|
|
53
|
+
(0, _tanstack_query_persist_client_core.persistQueryClientRestore)(options).then(() => refs.current.onSuccess?.()).catch(() => refs.current.onError?.()).finally(() => {
|
|
54
|
+
setIsRestoring(false);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
return isRestoring ? void 0 : (0, _tanstack_query_persist_client_core.persistQueryClientSubscribe)(options);
|
|
58
|
+
}, [props.client, isRestoring]);
|
|
59
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tanstack_react_query.QueryClientProvider, {
|
|
60
|
+
...props,
|
|
61
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tanstack_react_query.IsRestoringProvider, {
|
|
62
|
+
value: isRestoring,
|
|
63
|
+
children
|
|
64
|
+
})
|
|
65
|
+
});
|
|
68
66
|
};
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
});
|
|
67
|
+
//#endregion
|
|
68
|
+
exports.PersistQueryClientProvider = PersistQueryClientProvider;
|
|
69
|
+
|
|
73
70
|
//# sourceMappingURL=PersistQueryClientProvider.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"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\nexport type PersistQueryClientProviderProps = QueryClientProviderProps & {\n persistOptions: OmitKeyof<PersistQueryClientOptions, 'queryClient'>\n onSuccess?: () => Promise<unknown> | unknown\n onError?: () => Promise<unknown> | unknown\n}\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 refs = React.useRef({ persistOptions, onSuccess, onError })\n const didRestore = React.useRef(false)\n\n React.useEffect(() => {\n refs.current = { persistOptions, onSuccess, onError }\n })\n\n React.useEffect(() => {\n const options = {\n ...refs.current.persistOptions,\n queryClient: props.client,\n }\n if (!didRestore.current) {\n didRestore.current = true\n persistQueryClientRestore(options)\n .then(() => refs.current.onSuccess?.())\n .catch(() => refs.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":"
|
|
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\nexport type PersistQueryClientProviderProps = QueryClientProviderProps & {\n persistOptions: OmitKeyof<PersistQueryClientOptions, 'queryClient'>\n onSuccess?: () => Promise<unknown> | unknown\n onError?: () => Promise<unknown> | unknown\n}\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 refs = React.useRef({ persistOptions, onSuccess, onError })\n const didRestore = React.useRef(false)\n\n React.useEffect(() => {\n refs.current = { persistOptions, onSuccess, onError }\n })\n\n React.useEffect(() => {\n const options = {\n ...refs.current.persistOptions,\n queryClient: props.client,\n }\n if (!didRestore.current) {\n didRestore.current = true\n persistQueryClientRestore(options)\n .then(() => refs.current.onSuccess?.())\n .catch(() => refs.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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,MAAa,8BAA8B,EACzC,UACA,gBACA,WACA,SACA,GAAG,YACqD;CACxD,MAAM,CAAC,aAAa,kBAAkBA,MAAM,SAAS,IAAI;CACzD,MAAM,OAAOA,MAAM,OAAO;EAAE;EAAgB;EAAW;CAAQ,CAAC;CAChE,MAAM,aAAaA,MAAM,OAAO,KAAK;CAErC,MAAM,gBAAgB;EACpB,KAAK,UAAU;GAAE;GAAgB;GAAW;EAAQ;CACtD,CAAC;CAED,MAAM,gBAAgB;EACpB,MAAM,UAAU;GACd,GAAG,KAAK,QAAQ;GAChB,aAAa,MAAM;EACrB;EACA,IAAI,CAAC,WAAW,SAAS;GACvB,WAAW,UAAU;GACrB,CAAA,GAAA,oCAAA,0BAAA,CAA0B,OAAO,CAAC,CAC/B,WAAW,KAAK,QAAQ,YAAY,CAAC,CAAC,CACtC,YAAY,KAAK,QAAQ,UAAU,CAAC,CAAC,CACrC,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,2 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { PersistQueryClientOptions } from "@tanstack/query-persist-client-core";
|
|
3
|
+
import { OmitKeyof, QueryClientProviderProps } from "@tanstack/react-query";
|
|
4
|
+
//#region src/PersistQueryClientProvider.d.ts
|
|
5
|
+
type PersistQueryClientProviderProps = QueryClientProviderProps & {
|
|
6
|
+
persistOptions: OmitKeyof<PersistQueryClientOptions, 'queryClient'>;
|
|
7
|
+
onSuccess?: () => Promise<unknown> | unknown;
|
|
8
|
+
onError?: () => Promise<unknown> | unknown;
|
|
9
|
+
};
|
|
10
|
+
declare const PersistQueryClientProvider: ({ children, persistOptions, onSuccess, onError, ...props }: PersistQueryClientProviderProps) => React.JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { PersistQueryClientProvider, PersistQueryClientProviderProps };
|
|
13
|
+
//# sourceMappingURL=PersistQueryClientProvider.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PersistQueryClientProvider.d.cts","names":[],"sources":["../../src/PersistQueryClientProvider.tsx"],"mappings":";;;;KAWY,kCAAkC;EAC5C,gBAAgB,UAAU;EAC1B,kBAAkB;EAClB,gBAAgB;;cAGL,+BAA8B,UAAA,gBAAA,WAAA,YAAA,SAMxC,oCAAkC,MAAM,IAAI"}
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { PersistQueryClientOptions } from "@tanstack/query-persist-client-core";
|
|
3
|
+
import { OmitKeyof, QueryClientProviderProps } from "@tanstack/react-query";
|
|
4
|
+
//#region src/PersistQueryClientProvider.d.ts
|
|
5
|
+
type PersistQueryClientProviderProps = QueryClientProviderProps & {
|
|
6
|
+
persistOptions: OmitKeyof<PersistQueryClientOptions, 'queryClient'>;
|
|
7
|
+
onSuccess?: () => Promise<unknown> | unknown;
|
|
8
|
+
onError?: () => Promise<unknown> | unknown;
|
|
9
|
+
};
|
|
10
|
+
declare const PersistQueryClientProvider: ({ children, persistOptions, onSuccess, onError, ...props }: PersistQueryClientProviderProps) => React.JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { PersistQueryClientProvider, PersistQueryClientProviderProps };
|
|
13
|
+
//# sourceMappingURL=PersistQueryClientProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PersistQueryClientProvider.d.ts","names":[],"sources":["../../src/PersistQueryClientProvider.tsx"],"mappings":";;;;KAWY,kCAAkC;EAC5C,gBAAgB,UAAU;EAC1B,kBAAkB;EAClB,gBAAgB;;cAGL,+BAA8B,UAAA,gBAAA,WAAA,YAAA,SAMxC,oCAAkC,MAAM,IAAI"}
|
|
@@ -1,42 +1,46 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
// src/PersistQueryClientProvider.tsx
|
|
4
2
|
import * as React from "react";
|
|
5
|
-
import {
|
|
6
|
-
persistQueryClientRestore,
|
|
7
|
-
persistQueryClientSubscribe
|
|
8
|
-
} from "@tanstack/query-persist-client-core";
|
|
3
|
+
import { persistQueryClientRestore, persistQueryClientSubscribe } from "@tanstack/query-persist-client-core";
|
|
9
4
|
import { IsRestoringProvider, QueryClientProvider } from "@tanstack/react-query";
|
|
10
5
|
import { jsx } from "react/jsx-runtime";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
6
|
+
//#region src/PersistQueryClientProvider.tsx
|
|
7
|
+
const PersistQueryClientProvider = ({ children, persistOptions, onSuccess, onError, ...props }) => {
|
|
8
|
+
const [isRestoring, setIsRestoring] = React.useState(true);
|
|
9
|
+
const refs = React.useRef({
|
|
10
|
+
persistOptions,
|
|
11
|
+
onSuccess,
|
|
12
|
+
onError
|
|
13
|
+
});
|
|
14
|
+
const didRestore = React.useRef(false);
|
|
15
|
+
React.useEffect(() => {
|
|
16
|
+
refs.current = {
|
|
17
|
+
persistOptions,
|
|
18
|
+
onSuccess,
|
|
19
|
+
onError
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
React.useEffect(() => {
|
|
23
|
+
const options = {
|
|
24
|
+
...refs.current.persistOptions,
|
|
25
|
+
queryClient: props.client
|
|
26
|
+
};
|
|
27
|
+
if (!didRestore.current) {
|
|
28
|
+
didRestore.current = true;
|
|
29
|
+
persistQueryClientRestore(options).then(() => refs.current.onSuccess?.()).catch(() => refs.current.onError?.()).finally(() => {
|
|
30
|
+
setIsRestoring(false);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return isRestoring ? void 0 : persistQueryClientSubscribe(options);
|
|
34
|
+
}, [props.client, isRestoring]);
|
|
35
|
+
return /* @__PURE__ */ jsx(QueryClientProvider, {
|
|
36
|
+
...props,
|
|
37
|
+
children: /* @__PURE__ */ jsx(IsRestoringProvider, {
|
|
38
|
+
value: isRestoring,
|
|
39
|
+
children
|
|
40
|
+
})
|
|
41
|
+
});
|
|
41
42
|
};
|
|
43
|
+
//#endregion
|
|
44
|
+
export { PersistQueryClientProvider };
|
|
45
|
+
|
|
42
46
|
//# sourceMappingURL=PersistQueryClientProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"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\nexport type PersistQueryClientProviderProps = QueryClientProviderProps & {\n persistOptions: OmitKeyof<PersistQueryClientOptions, 'queryClient'>\n onSuccess?: () => Promise<unknown> | unknown\n onError?: () => Promise<unknown> | unknown\n}\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 refs = React.useRef({ persistOptions, onSuccess, onError })\n const didRestore = React.useRef(false)\n\n React.useEffect(() => {\n refs.current = { persistOptions, onSuccess, onError }\n })\n\n React.useEffect(() => {\n const options = {\n ...refs.current.persistOptions,\n queryClient: props.client,\n }\n if (!didRestore.current) {\n didRestore.current = true\n persistQueryClientRestore(options)\n .then(() => refs.current.onSuccess?.())\n .catch(() => refs.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":"
|
|
1
|
+
{"version":3,"file":"PersistQueryClientProvider.js","names":[],"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\nexport type PersistQueryClientProviderProps = QueryClientProviderProps & {\n persistOptions: OmitKeyof<PersistQueryClientOptions, 'queryClient'>\n onSuccess?: () => Promise<unknown> | unknown\n onError?: () => Promise<unknown> | unknown\n}\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 refs = React.useRef({ persistOptions, onSuccess, onError })\n const didRestore = React.useRef(false)\n\n React.useEffect(() => {\n refs.current = { persistOptions, onSuccess, onError }\n })\n\n React.useEffect(() => {\n const options = {\n ...refs.current.persistOptions,\n queryClient: props.client,\n }\n if (!didRestore.current) {\n didRestore.current = true\n persistQueryClientRestore(options)\n .then(() => refs.current.onSuccess?.())\n .catch(() => refs.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":";;;;;;AAiBA,MAAa,8BAA8B,EACzC,UACA,gBACA,WACA,SACA,GAAG,YACqD;CACxD,MAAM,CAAC,aAAa,kBAAkB,MAAM,SAAS,IAAI;CACzD,MAAM,OAAO,MAAM,OAAO;EAAE;EAAgB;EAAW;CAAQ,CAAC;CAChE,MAAM,aAAa,MAAM,OAAO,KAAK;CAErC,MAAM,gBAAgB;EACpB,KAAK,UAAU;GAAE;GAAgB;GAAW;EAAQ;CACtD,CAAC;CAED,MAAM,gBAAgB;EACpB,MAAM,UAAU;GACd,GAAG,KAAK,QAAQ;GAChB,aAAa,MAAM;EACrB;EACA,IAAI,CAAC,WAAW,SAAS;GACvB,WAAW,UAAU;GACrB,0BAA0B,OAAO,CAAC,CAC/B,WAAW,KAAK,QAAQ,YAAY,CAAC,CAAC,CACtC,YAAY,KAAK,QAAQ,UAAU,CAAC,CAAC,CACrC,cAAc;IACb,eAAe,KAAK;GACtB,CAAC;EACL;EACA,OAAO,cAAc,KAAA,IAAY,4BAA4B,OAAO;CACtE,GAAG,CAAC,MAAM,QAAQ,WAAW,CAAC;CAE9B,OACE,oBAAC,qBAAD;EAAqB,GAAI;EACvB,UAAA,oBAAC,qBAAD;GAAqB,OAAO;GAAc;EAA8B,CAAA;CACrD,CAAA;AAEzB"}
|
package/build/modern/index.cjs
CHANGED
|
@@ -1,27 +1,12 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
-
|
|
17
|
-
// src/index.ts
|
|
18
|
-
var index_exports = {};
|
|
19
|
-
module.exports = __toCommonJS(index_exports);
|
|
20
|
-
__reExport(index_exports, require("@tanstack/query-persist-client-core"), module.exports);
|
|
21
|
-
__reExport(index_exports, require("./PersistQueryClientProvider.cjs"), module.exports);
|
|
22
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
23
|
-
0 && (module.exports = {
|
|
24
|
-
...require("@tanstack/query-persist-client-core"),
|
|
25
|
-
...require("./PersistQueryClientProvider.cjs")
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_PersistQueryClientProvider = require("./PersistQueryClientProvider.cjs");
|
|
3
|
+
exports.PersistQueryClientProvider = require_PersistQueryClientProvider.PersistQueryClientProvider;
|
|
4
|
+
var _tanstack_query_persist_client_core = require("@tanstack/query-persist-client-core");
|
|
5
|
+
Object.keys(_tanstack_query_persist_client_core).forEach(function(k) {
|
|
6
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function() {
|
|
9
|
+
return _tanstack_query_persist_client_core[k];
|
|
10
|
+
}
|
|
11
|
+
});
|
|
26
12
|
});
|
|
27
|
-
//# sourceMappingURL=index.cjs.map
|
package/build/modern/index.d.cts
CHANGED
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export {
|
|
4
|
-
export { persistQueryClient } from './_tsup-dts-rollup.cjs';
|
|
5
|
-
export { Promisable } from './_tsup-dts-rollup.cjs';
|
|
6
|
-
export { Persister } from './_tsup-dts-rollup.cjs';
|
|
7
|
-
export { PersistedClient } from './_tsup-dts-rollup.cjs';
|
|
8
|
-
export { PersistQueryClientRootOptions } from './_tsup-dts-rollup.cjs';
|
|
9
|
-
export { PersistedQueryClientRestoreOptions } from './_tsup-dts-rollup.cjs';
|
|
10
|
-
export { PersistedQueryClientSaveOptions } from './_tsup-dts-rollup.cjs';
|
|
11
|
-
export { PersistQueryClientOptions } from './_tsup-dts-rollup.cjs';
|
|
12
|
-
export { PersistRetryer } from './_tsup-dts-rollup.cjs';
|
|
13
|
-
export { removeOldestQuery } from './_tsup-dts-rollup.cjs';
|
|
14
|
-
export { experimental_createQueryPersister } from './_tsup-dts-rollup.cjs';
|
|
15
|
-
export { PersistedQuery } from './_tsup-dts-rollup.cjs';
|
|
16
|
-
export { MaybePromise } from './_tsup-dts-rollup.cjs';
|
|
17
|
-
export { AsyncStorage } from './_tsup-dts-rollup.cjs';
|
|
18
|
-
export { StoragePersisterOptions } from './_tsup-dts-rollup.cjs';
|
|
19
|
-
export { PERSISTER_KEY_PREFIX } from './_tsup-dts-rollup.cjs';
|
|
20
|
-
export { PersistQueryClientProviderProps_alias_1 as PersistQueryClientProviderProps } from './_tsup-dts-rollup.cjs';
|
|
21
|
-
export { PersistQueryClientProvider_alias_1 as PersistQueryClientProvider } from './_tsup-dts-rollup.cjs';
|
|
1
|
+
import { PersistQueryClientProvider, PersistQueryClientProviderProps } from "./PersistQueryClientProvider.cjs";
|
|
2
|
+
export * from "@tanstack/query-persist-client-core";
|
|
3
|
+
export { PersistQueryClientProvider, PersistQueryClientProviderProps };
|
package/build/modern/index.d.ts
CHANGED
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export {
|
|
4
|
-
export { persistQueryClient } from './_tsup-dts-rollup.js';
|
|
5
|
-
export { Promisable } from './_tsup-dts-rollup.js';
|
|
6
|
-
export { Persister } from './_tsup-dts-rollup.js';
|
|
7
|
-
export { PersistedClient } from './_tsup-dts-rollup.js';
|
|
8
|
-
export { PersistQueryClientRootOptions } from './_tsup-dts-rollup.js';
|
|
9
|
-
export { PersistedQueryClientRestoreOptions } from './_tsup-dts-rollup.js';
|
|
10
|
-
export { PersistedQueryClientSaveOptions } from './_tsup-dts-rollup.js';
|
|
11
|
-
export { PersistQueryClientOptions } from './_tsup-dts-rollup.js';
|
|
12
|
-
export { PersistRetryer } from './_tsup-dts-rollup.js';
|
|
13
|
-
export { removeOldestQuery } from './_tsup-dts-rollup.js';
|
|
14
|
-
export { experimental_createQueryPersister } from './_tsup-dts-rollup.js';
|
|
15
|
-
export { PersistedQuery } from './_tsup-dts-rollup.js';
|
|
16
|
-
export { MaybePromise } from './_tsup-dts-rollup.js';
|
|
17
|
-
export { AsyncStorage } from './_tsup-dts-rollup.js';
|
|
18
|
-
export { StoragePersisterOptions } from './_tsup-dts-rollup.js';
|
|
19
|
-
export { PERSISTER_KEY_PREFIX } from './_tsup-dts-rollup.js';
|
|
20
|
-
export { PersistQueryClientProviderProps_alias_1 as PersistQueryClientProviderProps } from './_tsup-dts-rollup.js';
|
|
21
|
-
export { PersistQueryClientProvider_alias_1 as PersistQueryClientProvider } from './_tsup-dts-rollup.js';
|
|
1
|
+
import { PersistQueryClientProvider, PersistQueryClientProviderProps } from "./PersistQueryClientProvider.js";
|
|
2
|
+
export * from "@tanstack/query-persist-client-core";
|
|
3
|
+
export { PersistQueryClientProvider, PersistQueryClientProviderProps };
|
package/build/modern/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import { PersistQueryClientProvider } from "./PersistQueryClientProvider.js";
|
|
2
2
|
export * from "@tanstack/query-persist-client-core";
|
|
3
|
-
export
|
|
4
|
-
//# sourceMappingURL=index.js.map
|
|
3
|
+
export { PersistQueryClientProvider };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/react-query-persist-client",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.102.1",
|
|
4
4
|
"description": "React bindings to work with persisters in TanStack/react-query",
|
|
5
5
|
"author": "tannerlinsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"!src/__tests__"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@tanstack/query-persist-client-core": "5.
|
|
43
|
+
"@tanstack/query-persist-client-core": "5.102.1"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@testing-library/react": "^16.1.0",
|
|
@@ -49,28 +49,26 @@
|
|
|
49
49
|
"npm-run-all2": "^5.0.0",
|
|
50
50
|
"react": "^19.2.1",
|
|
51
51
|
"@tanstack/query-test-utils": "0.0.0",
|
|
52
|
-
"@tanstack/react-query": "5.
|
|
52
|
+
"@tanstack/react-query": "5.102.1"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"react": "^18 || ^19",
|
|
56
|
-
"@tanstack/react-query": "^5.
|
|
56
|
+
"@tanstack/react-query": "^5.102.1"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"clean": "premove ./build ./coverage ./dist-ts",
|
|
60
60
|
"compile": "tsc --build",
|
|
61
61
|
"test:eslint": "eslint --concurrency=auto ./src",
|
|
62
62
|
"test:types": "npm-run-all --serial test:types:*",
|
|
63
|
-
"test:types:ts54": "node ../../node_modules/typescript54/lib/tsc.js --build tsconfig.legacy.json",
|
|
64
|
-
"test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js --build tsconfig.legacy.json",
|
|
65
63
|
"test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --build tsconfig.legacy.json",
|
|
66
64
|
"test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --build tsconfig.legacy.json",
|
|
67
65
|
"test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js --build tsconfig.legacy.json",
|
|
68
66
|
"test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js --build tsconfig.legacy.json",
|
|
69
67
|
"test:types:tscurrent": "tsc --build",
|
|
70
|
-
"test:types:
|
|
68
|
+
"test:types:ts70": "node ../../node_modules/typescript70/lib/tsc.js --build tsconfig.legacy.json",
|
|
71
69
|
"test:lib": "vitest --retry=3",
|
|
72
70
|
"test:lib:dev": "pnpm run test:lib --watch",
|
|
73
71
|
"test:build": "publint --strict && attw --pack",
|
|
74
|
-
"build": "
|
|
72
|
+
"build": "tsdown --tsconfig tsconfig.prod.json"
|
|
75
73
|
}
|
|
76
74
|
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { AsyncStorage } from '@tanstack/query-persist-client-core';
|
|
2
|
-
import { experimental_createQueryPersister } from '@tanstack/query-persist-client-core';
|
|
3
|
-
import { MaybePromise } from '@tanstack/query-persist-client-core';
|
|
4
|
-
import type { OmitKeyof } from '@tanstack/react-query';
|
|
5
|
-
import { PersistedClient } from '@tanstack/query-persist-client-core';
|
|
6
|
-
import { PersistedQuery } from '@tanstack/query-persist-client-core';
|
|
7
|
-
import { PersistedQueryClientRestoreOptions } from '@tanstack/query-persist-client-core';
|
|
8
|
-
import { PersistedQueryClientSaveOptions } from '@tanstack/query-persist-client-core';
|
|
9
|
-
import { Persister } from '@tanstack/query-persist-client-core';
|
|
10
|
-
import { PERSISTER_KEY_PREFIX } from '@tanstack/query-persist-client-core';
|
|
11
|
-
import { persistQueryClient } from '@tanstack/query-persist-client-core';
|
|
12
|
-
import { PersistQueryClientOptions } from '@tanstack/query-persist-client-core';
|
|
13
|
-
import { persistQueryClientRestore } from '@tanstack/query-persist-client-core';
|
|
14
|
-
import { PersistQueryClientRootOptions } from '@tanstack/query-persist-client-core';
|
|
15
|
-
import { persistQueryClientSave } from '@tanstack/query-persist-client-core';
|
|
16
|
-
import { persistQueryClientSubscribe } from '@tanstack/query-persist-client-core';
|
|
17
|
-
import { PersistRetryer } from '@tanstack/query-persist-client-core';
|
|
18
|
-
import { Promisable } from '@tanstack/query-persist-client-core';
|
|
19
|
-
import type { QueryClientProviderProps } from '@tanstack/react-query';
|
|
20
|
-
import * as React_2 from 'react';
|
|
21
|
-
import { removeOldestQuery } from '@tanstack/query-persist-client-core';
|
|
22
|
-
import { StoragePersisterOptions } from '@tanstack/query-persist-client-core';
|
|
23
|
-
|
|
24
|
-
export { AsyncStorage }
|
|
25
|
-
|
|
26
|
-
export { experimental_createQueryPersister }
|
|
27
|
-
|
|
28
|
-
export { MaybePromise }
|
|
29
|
-
|
|
30
|
-
export { PersistedClient }
|
|
31
|
-
|
|
32
|
-
export { PersistedQuery }
|
|
33
|
-
|
|
34
|
-
export { PersistedQueryClientRestoreOptions }
|
|
35
|
-
|
|
36
|
-
export { PersistedQueryClientSaveOptions }
|
|
37
|
-
|
|
38
|
-
export { Persister }
|
|
39
|
-
|
|
40
|
-
export { PERSISTER_KEY_PREFIX }
|
|
41
|
-
|
|
42
|
-
export { persistQueryClient }
|
|
43
|
-
|
|
44
|
-
export { PersistQueryClientOptions }
|
|
45
|
-
|
|
46
|
-
declare const PersistQueryClientProvider: ({ children, persistOptions, onSuccess, onError, ...props }: PersistQueryClientProviderProps) => React_2.JSX.Element;
|
|
47
|
-
export { PersistQueryClientProvider }
|
|
48
|
-
export { PersistQueryClientProvider as PersistQueryClientProvider_alias_1 }
|
|
49
|
-
|
|
50
|
-
declare type PersistQueryClientProviderProps = QueryClientProviderProps & {
|
|
51
|
-
persistOptions: OmitKeyof<PersistQueryClientOptions, 'queryClient'>;
|
|
52
|
-
onSuccess?: () => Promise<unknown> | unknown;
|
|
53
|
-
onError?: () => Promise<unknown> | unknown;
|
|
54
|
-
};
|
|
55
|
-
export { PersistQueryClientProviderProps }
|
|
56
|
-
export { PersistQueryClientProviderProps as PersistQueryClientProviderProps_alias_1 }
|
|
57
|
-
|
|
58
|
-
export { persistQueryClientRestore }
|
|
59
|
-
|
|
60
|
-
export { PersistQueryClientRootOptions }
|
|
61
|
-
|
|
62
|
-
export { persistQueryClientSave }
|
|
63
|
-
|
|
64
|
-
export { persistQueryClientSubscribe }
|
|
65
|
-
|
|
66
|
-
export { PersistRetryer }
|
|
67
|
-
|
|
68
|
-
export { Promisable }
|
|
69
|
-
|
|
70
|
-
export { removeOldestQuery }
|
|
71
|
-
|
|
72
|
-
export { StoragePersisterOptions }
|
|
73
|
-
|
|
74
|
-
export { }
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { AsyncStorage } from '@tanstack/query-persist-client-core';
|
|
2
|
-
import { experimental_createQueryPersister } from '@tanstack/query-persist-client-core';
|
|
3
|
-
import { MaybePromise } from '@tanstack/query-persist-client-core';
|
|
4
|
-
import type { OmitKeyof } from '@tanstack/react-query';
|
|
5
|
-
import { PersistedClient } from '@tanstack/query-persist-client-core';
|
|
6
|
-
import { PersistedQuery } from '@tanstack/query-persist-client-core';
|
|
7
|
-
import { PersistedQueryClientRestoreOptions } from '@tanstack/query-persist-client-core';
|
|
8
|
-
import { PersistedQueryClientSaveOptions } from '@tanstack/query-persist-client-core';
|
|
9
|
-
import { Persister } from '@tanstack/query-persist-client-core';
|
|
10
|
-
import { PERSISTER_KEY_PREFIX } from '@tanstack/query-persist-client-core';
|
|
11
|
-
import { persistQueryClient } from '@tanstack/query-persist-client-core';
|
|
12
|
-
import { PersistQueryClientOptions } from '@tanstack/query-persist-client-core';
|
|
13
|
-
import { persistQueryClientRestore } from '@tanstack/query-persist-client-core';
|
|
14
|
-
import { PersistQueryClientRootOptions } from '@tanstack/query-persist-client-core';
|
|
15
|
-
import { persistQueryClientSave } from '@tanstack/query-persist-client-core';
|
|
16
|
-
import { persistQueryClientSubscribe } from '@tanstack/query-persist-client-core';
|
|
17
|
-
import { PersistRetryer } from '@tanstack/query-persist-client-core';
|
|
18
|
-
import { Promisable } from '@tanstack/query-persist-client-core';
|
|
19
|
-
import type { QueryClientProviderProps } from '@tanstack/react-query';
|
|
20
|
-
import * as React_2 from 'react';
|
|
21
|
-
import { removeOldestQuery } from '@tanstack/query-persist-client-core';
|
|
22
|
-
import { StoragePersisterOptions } from '@tanstack/query-persist-client-core';
|
|
23
|
-
|
|
24
|
-
export { AsyncStorage }
|
|
25
|
-
|
|
26
|
-
export { experimental_createQueryPersister }
|
|
27
|
-
|
|
28
|
-
export { MaybePromise }
|
|
29
|
-
|
|
30
|
-
export { PersistedClient }
|
|
31
|
-
|
|
32
|
-
export { PersistedQuery }
|
|
33
|
-
|
|
34
|
-
export { PersistedQueryClientRestoreOptions }
|
|
35
|
-
|
|
36
|
-
export { PersistedQueryClientSaveOptions }
|
|
37
|
-
|
|
38
|
-
export { Persister }
|
|
39
|
-
|
|
40
|
-
export { PERSISTER_KEY_PREFIX }
|
|
41
|
-
|
|
42
|
-
export { persistQueryClient }
|
|
43
|
-
|
|
44
|
-
export { PersistQueryClientOptions }
|
|
45
|
-
|
|
46
|
-
declare const PersistQueryClientProvider: ({ children, persistOptions, onSuccess, onError, ...props }: PersistQueryClientProviderProps) => React_2.JSX.Element;
|
|
47
|
-
export { PersistQueryClientProvider }
|
|
48
|
-
export { PersistQueryClientProvider as PersistQueryClientProvider_alias_1 }
|
|
49
|
-
|
|
50
|
-
declare type PersistQueryClientProviderProps = QueryClientProviderProps & {
|
|
51
|
-
persistOptions: OmitKeyof<PersistQueryClientOptions, 'queryClient'>;
|
|
52
|
-
onSuccess?: () => Promise<unknown> | unknown;
|
|
53
|
-
onError?: () => Promise<unknown> | unknown;
|
|
54
|
-
};
|
|
55
|
-
export { PersistQueryClientProviderProps }
|
|
56
|
-
export { PersistQueryClientProviderProps as PersistQueryClientProviderProps_alias_1 }
|
|
57
|
-
|
|
58
|
-
export { persistQueryClientRestore }
|
|
59
|
-
|
|
60
|
-
export { PersistQueryClientRootOptions }
|
|
61
|
-
|
|
62
|
-
export { persistQueryClientSave }
|
|
63
|
-
|
|
64
|
-
export { persistQueryClientSubscribe }
|
|
65
|
-
|
|
66
|
-
export { PersistRetryer }
|
|
67
|
-
|
|
68
|
-
export { Promisable }
|
|
69
|
-
|
|
70
|
-
export { removeOldestQuery }
|
|
71
|
-
|
|
72
|
-
export { StoragePersisterOptions }
|
|
73
|
-
|
|
74
|
-
export { }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["// Re-export core\nexport * from '@tanstack/query-persist-client-core'\n\nexport * from './PersistQueryClientProvider'\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AACA,0BAAc,gDADd;AAGA,0BAAc,6CAHd;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["// Re-export core\nexport * from '@tanstack/query-persist-client-core'\n\nexport * from './PersistQueryClientProvider'\n"],"mappings":";AACA,cAAc;AAEd,cAAc;","names":[]}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { AsyncStorage } from '@tanstack/query-persist-client-core';
|
|
2
|
-
import { experimental_createQueryPersister } from '@tanstack/query-persist-client-core';
|
|
3
|
-
import { MaybePromise } from '@tanstack/query-persist-client-core';
|
|
4
|
-
import type { OmitKeyof } from '@tanstack/react-query';
|
|
5
|
-
import { PersistedClient } from '@tanstack/query-persist-client-core';
|
|
6
|
-
import { PersistedQuery } from '@tanstack/query-persist-client-core';
|
|
7
|
-
import { PersistedQueryClientRestoreOptions } from '@tanstack/query-persist-client-core';
|
|
8
|
-
import { PersistedQueryClientSaveOptions } from '@tanstack/query-persist-client-core';
|
|
9
|
-
import { Persister } from '@tanstack/query-persist-client-core';
|
|
10
|
-
import { PERSISTER_KEY_PREFIX } from '@tanstack/query-persist-client-core';
|
|
11
|
-
import { persistQueryClient } from '@tanstack/query-persist-client-core';
|
|
12
|
-
import { PersistQueryClientOptions } from '@tanstack/query-persist-client-core';
|
|
13
|
-
import { persistQueryClientRestore } from '@tanstack/query-persist-client-core';
|
|
14
|
-
import { PersistQueryClientRootOptions } from '@tanstack/query-persist-client-core';
|
|
15
|
-
import { persistQueryClientSave } from '@tanstack/query-persist-client-core';
|
|
16
|
-
import { persistQueryClientSubscribe } from '@tanstack/query-persist-client-core';
|
|
17
|
-
import { PersistRetryer } from '@tanstack/query-persist-client-core';
|
|
18
|
-
import { Promisable } from '@tanstack/query-persist-client-core';
|
|
19
|
-
import type { QueryClientProviderProps } from '@tanstack/react-query';
|
|
20
|
-
import * as React_2 from 'react';
|
|
21
|
-
import { removeOldestQuery } from '@tanstack/query-persist-client-core';
|
|
22
|
-
import { StoragePersisterOptions } from '@tanstack/query-persist-client-core';
|
|
23
|
-
|
|
24
|
-
export { AsyncStorage }
|
|
25
|
-
|
|
26
|
-
export { experimental_createQueryPersister }
|
|
27
|
-
|
|
28
|
-
export { MaybePromise }
|
|
29
|
-
|
|
30
|
-
export { PersistedClient }
|
|
31
|
-
|
|
32
|
-
export { PersistedQuery }
|
|
33
|
-
|
|
34
|
-
export { PersistedQueryClientRestoreOptions }
|
|
35
|
-
|
|
36
|
-
export { PersistedQueryClientSaveOptions }
|
|
37
|
-
|
|
38
|
-
export { Persister }
|
|
39
|
-
|
|
40
|
-
export { PERSISTER_KEY_PREFIX }
|
|
41
|
-
|
|
42
|
-
export { persistQueryClient }
|
|
43
|
-
|
|
44
|
-
export { PersistQueryClientOptions }
|
|
45
|
-
|
|
46
|
-
declare const PersistQueryClientProvider: ({ children, persistOptions, onSuccess, onError, ...props }: PersistQueryClientProviderProps) => React_2.JSX.Element;
|
|
47
|
-
export { PersistQueryClientProvider }
|
|
48
|
-
export { PersistQueryClientProvider as PersistQueryClientProvider_alias_1 }
|
|
49
|
-
|
|
50
|
-
declare type PersistQueryClientProviderProps = QueryClientProviderProps & {
|
|
51
|
-
persistOptions: OmitKeyof<PersistQueryClientOptions, 'queryClient'>;
|
|
52
|
-
onSuccess?: () => Promise<unknown> | unknown;
|
|
53
|
-
onError?: () => Promise<unknown> | unknown;
|
|
54
|
-
};
|
|
55
|
-
export { PersistQueryClientProviderProps }
|
|
56
|
-
export { PersistQueryClientProviderProps as PersistQueryClientProviderProps_alias_1 }
|
|
57
|
-
|
|
58
|
-
export { persistQueryClientRestore }
|
|
59
|
-
|
|
60
|
-
export { PersistQueryClientRootOptions }
|
|
61
|
-
|
|
62
|
-
export { persistQueryClientSave }
|
|
63
|
-
|
|
64
|
-
export { persistQueryClientSubscribe }
|
|
65
|
-
|
|
66
|
-
export { PersistRetryer }
|
|
67
|
-
|
|
68
|
-
export { Promisable }
|
|
69
|
-
|
|
70
|
-
export { removeOldestQuery }
|
|
71
|
-
|
|
72
|
-
export { StoragePersisterOptions }
|
|
73
|
-
|
|
74
|
-
export { }
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { AsyncStorage } from '@tanstack/query-persist-client-core';
|
|
2
|
-
import { experimental_createQueryPersister } from '@tanstack/query-persist-client-core';
|
|
3
|
-
import { MaybePromise } from '@tanstack/query-persist-client-core';
|
|
4
|
-
import type { OmitKeyof } from '@tanstack/react-query';
|
|
5
|
-
import { PersistedClient } from '@tanstack/query-persist-client-core';
|
|
6
|
-
import { PersistedQuery } from '@tanstack/query-persist-client-core';
|
|
7
|
-
import { PersistedQueryClientRestoreOptions } from '@tanstack/query-persist-client-core';
|
|
8
|
-
import { PersistedQueryClientSaveOptions } from '@tanstack/query-persist-client-core';
|
|
9
|
-
import { Persister } from '@tanstack/query-persist-client-core';
|
|
10
|
-
import { PERSISTER_KEY_PREFIX } from '@tanstack/query-persist-client-core';
|
|
11
|
-
import { persistQueryClient } from '@tanstack/query-persist-client-core';
|
|
12
|
-
import { PersistQueryClientOptions } from '@tanstack/query-persist-client-core';
|
|
13
|
-
import { persistQueryClientRestore } from '@tanstack/query-persist-client-core';
|
|
14
|
-
import { PersistQueryClientRootOptions } from '@tanstack/query-persist-client-core';
|
|
15
|
-
import { persistQueryClientSave } from '@tanstack/query-persist-client-core';
|
|
16
|
-
import { persistQueryClientSubscribe } from '@tanstack/query-persist-client-core';
|
|
17
|
-
import { PersistRetryer } from '@tanstack/query-persist-client-core';
|
|
18
|
-
import { Promisable } from '@tanstack/query-persist-client-core';
|
|
19
|
-
import type { QueryClientProviderProps } from '@tanstack/react-query';
|
|
20
|
-
import * as React_2 from 'react';
|
|
21
|
-
import { removeOldestQuery } from '@tanstack/query-persist-client-core';
|
|
22
|
-
import { StoragePersisterOptions } from '@tanstack/query-persist-client-core';
|
|
23
|
-
|
|
24
|
-
export { AsyncStorage }
|
|
25
|
-
|
|
26
|
-
export { experimental_createQueryPersister }
|
|
27
|
-
|
|
28
|
-
export { MaybePromise }
|
|
29
|
-
|
|
30
|
-
export { PersistedClient }
|
|
31
|
-
|
|
32
|
-
export { PersistedQuery }
|
|
33
|
-
|
|
34
|
-
export { PersistedQueryClientRestoreOptions }
|
|
35
|
-
|
|
36
|
-
export { PersistedQueryClientSaveOptions }
|
|
37
|
-
|
|
38
|
-
export { Persister }
|
|
39
|
-
|
|
40
|
-
export { PERSISTER_KEY_PREFIX }
|
|
41
|
-
|
|
42
|
-
export { persistQueryClient }
|
|
43
|
-
|
|
44
|
-
export { PersistQueryClientOptions }
|
|
45
|
-
|
|
46
|
-
declare const PersistQueryClientProvider: ({ children, persistOptions, onSuccess, onError, ...props }: PersistQueryClientProviderProps) => React_2.JSX.Element;
|
|
47
|
-
export { PersistQueryClientProvider }
|
|
48
|
-
export { PersistQueryClientProvider as PersistQueryClientProvider_alias_1 }
|
|
49
|
-
|
|
50
|
-
declare type PersistQueryClientProviderProps = QueryClientProviderProps & {
|
|
51
|
-
persistOptions: OmitKeyof<PersistQueryClientOptions, 'queryClient'>;
|
|
52
|
-
onSuccess?: () => Promise<unknown> | unknown;
|
|
53
|
-
onError?: () => Promise<unknown> | unknown;
|
|
54
|
-
};
|
|
55
|
-
export { PersistQueryClientProviderProps }
|
|
56
|
-
export { PersistQueryClientProviderProps as PersistQueryClientProviderProps_alias_1 }
|
|
57
|
-
|
|
58
|
-
export { persistQueryClientRestore }
|
|
59
|
-
|
|
60
|
-
export { PersistQueryClientRootOptions }
|
|
61
|
-
|
|
62
|
-
export { persistQueryClientSave }
|
|
63
|
-
|
|
64
|
-
export { persistQueryClientSubscribe }
|
|
65
|
-
|
|
66
|
-
export { PersistRetryer }
|
|
67
|
-
|
|
68
|
-
export { Promisable }
|
|
69
|
-
|
|
70
|
-
export { removeOldestQuery }
|
|
71
|
-
|
|
72
|
-
export { StoragePersisterOptions }
|
|
73
|
-
|
|
74
|
-
export { }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["// Re-export core\nexport * from '@tanstack/query-persist-client-core'\n\nexport * from './PersistQueryClientProvider'\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AACA,0BAAc,gDADd;AAGA,0BAAc,6CAHd;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["// Re-export core\nexport * from '@tanstack/query-persist-client-core'\n\nexport * from './PersistQueryClientProvider'\n"],"mappings":";AACA,cAAc;AAEd,cAAc;","names":[]}
|