@tanstack/preact-query-persist-client 5.101.4 → 5.102.0
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 +49 -65
- 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 +47 -45
- 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 +43 -59
- 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 +41 -39
- 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 +7 -9
- 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,68 +1,52 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let preact_hooks = require("preact/hooks");
|
|
3
|
+
let _tanstack_query_persist_client_core = require("@tanstack/query-persist-client-core");
|
|
4
|
+
let _tanstack_preact_query = require("@tanstack/preact-query");
|
|
5
|
+
let preact_jsx_runtime = require("preact/jsx-runtime");
|
|
6
|
+
//#region src/PersistQueryClientProvider.tsx
|
|
7
|
+
const PersistQueryClientProvider = ({ children, persistOptions, onSuccess, onError, ...props }) => {
|
|
8
|
+
const [isRestoring, setIsRestoring] = (0, preact_hooks.useState)(true);
|
|
9
|
+
const refs = (0, preact_hooks.useRef)({
|
|
10
|
+
persistOptions,
|
|
11
|
+
onSuccess,
|
|
12
|
+
onError
|
|
13
|
+
});
|
|
14
|
+
const didRestore = (0, preact_hooks.useRef)(false);
|
|
15
|
+
(0, preact_hooks.useEffect)(() => {
|
|
16
|
+
refs.current = {
|
|
17
|
+
persistOptions,
|
|
18
|
+
onSuccess,
|
|
19
|
+
onError
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
(0, preact_hooks.useEffect)(() => {
|
|
23
|
+
const options = {
|
|
24
|
+
...refs.current.persistOptions,
|
|
25
|
+
queryClient: props.client
|
|
26
|
+
};
|
|
27
|
+
if (!didRestore.current) {
|
|
28
|
+
didRestore.current = true;
|
|
29
|
+
(0, _tanstack_query_persist_client_core.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 : (0, _tanstack_query_persist_client_core.persistQueryClientSubscribe)(options);
|
|
40
|
+
}, [props.client, isRestoring]);
|
|
41
|
+
return /* @__PURE__ */ (0, preact_jsx_runtime.jsx)(_tanstack_preact_query.QueryClientProvider, {
|
|
42
|
+
...props,
|
|
43
|
+
children: /* @__PURE__ */ (0, preact_jsx_runtime.jsx)(_tanstack_preact_query.IsRestoringProvider, {
|
|
44
|
+
value: isRestoring,
|
|
45
|
+
children
|
|
46
|
+
})
|
|
47
|
+
});
|
|
9
48
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
49
|
+
//#endregion
|
|
50
|
+
exports.PersistQueryClientProvider = PersistQueryClientProvider;
|
|
19
51
|
|
|
20
|
-
// src/PersistQueryClientProvider.tsx
|
|
21
|
-
var PersistQueryClientProvider_exports = {};
|
|
22
|
-
__export(PersistQueryClientProvider_exports, {
|
|
23
|
-
PersistQueryClientProvider: () => PersistQueryClientProvider
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(PersistQueryClientProvider_exports);
|
|
26
|
-
var import_hooks = require("preact/hooks");
|
|
27
|
-
var import_query_persist_client_core = require("@tanstack/query-persist-client-core");
|
|
28
|
-
var import_preact_query = require("@tanstack/preact-query");
|
|
29
|
-
var import_jsx_runtime = require("preact/jsx-runtime");
|
|
30
|
-
var PersistQueryClientProvider = ({
|
|
31
|
-
children,
|
|
32
|
-
persistOptions,
|
|
33
|
-
onSuccess,
|
|
34
|
-
onError,
|
|
35
|
-
...props
|
|
36
|
-
}) => {
|
|
37
|
-
const [isRestoring, setIsRestoring] = (0, import_hooks.useState)(true);
|
|
38
|
-
const refs = (0, import_hooks.useRef)({ persistOptions, onSuccess, onError });
|
|
39
|
-
const didRestore = (0, import_hooks.useRef)(false);
|
|
40
|
-
(0, import_hooks.useEffect)(() => {
|
|
41
|
-
refs.current = { persistOptions, onSuccess, onError };
|
|
42
|
-
});
|
|
43
|
-
(0, import_hooks.useEffect)(() => {
|
|
44
|
-
const options = {
|
|
45
|
-
...refs.current.persistOptions,
|
|
46
|
-
queryClient: props.client
|
|
47
|
-
};
|
|
48
|
-
if (!didRestore.current) {
|
|
49
|
-
didRestore.current = true;
|
|
50
|
-
(0, import_query_persist_client_core.persistQueryClientRestore)(options).then(() => {
|
|
51
|
-
var _a, _b;
|
|
52
|
-
return (_b = (_a = refs.current).onSuccess) == null ? void 0 : _b.call(_a);
|
|
53
|
-
}).catch(() => {
|
|
54
|
-
var _a, _b;
|
|
55
|
-
return (_b = (_a = refs.current).onError) == null ? void 0 : _b.call(_a);
|
|
56
|
-
}).finally(() => {
|
|
57
|
-
setIsRestoring(false);
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
return isRestoring ? void 0 : (0, import_query_persist_client_core.persistQueryClientSubscribe)(options);
|
|
61
|
-
}, [props.client, isRestoring]);
|
|
62
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_preact_query.QueryClientProvider, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_preact_query.IsRestoringProvider, { value: isRestoring, children }) });
|
|
63
|
-
};
|
|
64
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
65
|
-
0 && (module.exports = {
|
|
66
|
-
PersistQueryClientProvider
|
|
67
|
-
});
|
|
68
52
|
//# sourceMappingURL=PersistQueryClientProvider.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/PersistQueryClientProvider.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'preact/hooks'\nimport type { VNode } from 'preact'\n\nimport {\n persistQueryClientRestore,\n persistQueryClientSubscribe,\n} from '@tanstack/query-persist-client-core'\nimport {\n IsRestoringProvider,\n QueryClientProvider,\n} from '@tanstack/preact-query'\nimport type { PersistQueryClientOptions } from '@tanstack/query-persist-client-core'\nimport type {\n OmitKeyof,\n QueryClientProviderProps,\n} from '@tanstack/preact-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): VNode => {\n const [isRestoring, setIsRestoring] = useState(true)\n const refs = useRef({ persistOptions, onSuccess, onError })\n const didRestore = useRef(false)\n\n useEffect(() => {\n refs.current = { persistOptions, onSuccess, onError }\n })\n\n 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":["useState","useRef","persistQueryClientSubscribe","QueryClientProvider","IsRestoringProvider"],"sources":["../../src/PersistQueryClientProvider.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'preact/hooks'\nimport type { VNode } from 'preact'\n\nimport {\n persistQueryClientRestore,\n persistQueryClientSubscribe,\n} from '@tanstack/query-persist-client-core'\nimport {\n IsRestoringProvider,\n QueryClientProvider,\n} from '@tanstack/preact-query'\nimport type { PersistQueryClientOptions } from '@tanstack/query-persist-client-core'\nimport type {\n OmitKeyof,\n QueryClientProviderProps,\n} from '@tanstack/preact-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): VNode => {\n const [isRestoring, setIsRestoring] = useState(true)\n const refs = useRef({ persistOptions, onSuccess, onError })\n const didRestore = useRef(false)\n\n useEffect(() => {\n refs.current = { persistOptions, onSuccess, onError }\n })\n\n 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":";;;;;;AAuBA,MAAa,8BAA8B,EACzC,UACA,gBACA,WACA,SACA,GAAG,YACyC;CAC5C,MAAM,CAAC,aAAa,mBAAA,GAAkBA,aAAAA,SAAAA,CAAS,IAAI;CACnD,MAAM,QAAA,GAAOC,aAAAA,OAAAA,CAAO;EAAE;EAAgB;EAAW;CAAQ,CAAC;CAC1D,MAAM,cAAA,GAAaA,aAAAA,OAAAA,CAAO,KAAK;CAE/B,CAAA,GAAA,aAAA,UAAA,OAAgB;EACd,KAAK,UAAU;GAAE;GAAgB;GAAW;EAAQ;CACtD,CAAC;CAED,CAAA,GAAA,aAAA,UAAA,OAAgB;EACd,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,mBAAA,IAAA,CAACC,uBAAAA,qBAAD;EAAqB,GAAI;EACvB,UAAA,iBAAA,GAAA,mBAAA,IAAA,CAACC,uBAAAA,qBAAD;GAAqB,OAAO;GAAc;EAA8B,CAAA;CACrD,CAAA;AAEzB"}
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { VNode } from "preact";
|
|
2
|
+
import { PersistQueryClientOptions } from "@tanstack/query-persist-client-core";
|
|
3
|
+
import { OmitKeyof, QueryClientProviderProps } from "@tanstack/preact-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) => VNode;
|
|
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":";;;;KAiBY,kCAAkC;EAC5C,gBAAgB,UAAU;EAC1B,kBAAkB;EAClB,gBAAgB;;cAGL,+BAA8B,UAAA,gBAAA,WAAA,YAAA,SAMxC,oCAAkC"}
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { PersistQueryClientOptions } from "@tanstack/query-persist-client-core";
|
|
2
|
+
import { OmitKeyof, QueryClientProviderProps } from "@tanstack/preact-query";
|
|
3
|
+
import { VNode } from "preact";
|
|
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) => VNode;
|
|
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":";;;;KAiBY,kCAAkC;EAC5C,gBAAgB,UAAU;EAC1B,kBAAkB;EAClB,gBAAgB;;cAGL,+BAA8B,UAAA,gBAAA,WAAA,YAAA,SAMxC,oCAAkC"}
|
|
@@ -1,49 +1,51 @@
|
|
|
1
|
-
// src/PersistQueryClientProvider.tsx
|
|
2
1
|
import { useEffect, useRef, useState } from "preact/hooks";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
persistQueryClientSubscribe
|
|
6
|
-
} from "@tanstack/query-persist-client-core";
|
|
7
|
-
import {
|
|
8
|
-
IsRestoringProvider,
|
|
9
|
-
QueryClientProvider
|
|
10
|
-
} from "@tanstack/preact-query";
|
|
2
|
+
import { persistQueryClientRestore, persistQueryClientSubscribe } from "@tanstack/query-persist-client-core";
|
|
3
|
+
import { IsRestoringProvider, QueryClientProvider } from "@tanstack/preact-query";
|
|
11
4
|
import { jsx } from "preact/jsx-runtime";
|
|
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
|
-
|
|
47
|
-
|
|
5
|
+
//#region src/PersistQueryClientProvider.tsx
|
|
6
|
+
const PersistQueryClientProvider = ({ children, persistOptions, onSuccess, onError, ...props }) => {
|
|
7
|
+
const [isRestoring, setIsRestoring] = useState(true);
|
|
8
|
+
const refs = useRef({
|
|
9
|
+
persistOptions,
|
|
10
|
+
onSuccess,
|
|
11
|
+
onError
|
|
12
|
+
});
|
|
13
|
+
const didRestore = useRef(false);
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
refs.current = {
|
|
16
|
+
persistOptions,
|
|
17
|
+
onSuccess,
|
|
18
|
+
onError
|
|
19
|
+
};
|
|
20
|
+
});
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
const options = {
|
|
23
|
+
...refs.current.persistOptions,
|
|
24
|
+
queryClient: props.client
|
|
25
|
+
};
|
|
26
|
+
if (!didRestore.current) {
|
|
27
|
+
didRestore.current = true;
|
|
28
|
+
persistQueryClientRestore(options).then(() => {
|
|
29
|
+
var _refs$current$onSucce, _refs$current;
|
|
30
|
+
return (_refs$current$onSucce = (_refs$current = refs.current).onSuccess) === null || _refs$current$onSucce === void 0 ? void 0 : _refs$current$onSucce.call(_refs$current);
|
|
31
|
+
}).catch(() => {
|
|
32
|
+
var _refs$current$onError, _refs$current2;
|
|
33
|
+
return (_refs$current$onError = (_refs$current2 = refs.current).onError) === null || _refs$current$onError === void 0 ? void 0 : _refs$current$onError.call(_refs$current2);
|
|
34
|
+
}).finally(() => {
|
|
35
|
+
setIsRestoring(false);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return isRestoring ? void 0 : persistQueryClientSubscribe(options);
|
|
39
|
+
}, [props.client, isRestoring]);
|
|
40
|
+
return /* @__PURE__ */ jsx(QueryClientProvider, {
|
|
41
|
+
...props,
|
|
42
|
+
children: /* @__PURE__ */ jsx(IsRestoringProvider, {
|
|
43
|
+
value: isRestoring,
|
|
44
|
+
children
|
|
45
|
+
})
|
|
46
|
+
});
|
|
48
47
|
};
|
|
48
|
+
//#endregion
|
|
49
|
+
export { PersistQueryClientProvider };
|
|
50
|
+
|
|
49
51
|
//# sourceMappingURL=PersistQueryClientProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/PersistQueryClientProvider.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'preact/hooks'\nimport type { VNode } from 'preact'\n\nimport {\n persistQueryClientRestore,\n persistQueryClientSubscribe,\n} from '@tanstack/query-persist-client-core'\nimport {\n IsRestoringProvider,\n QueryClientProvider,\n} from '@tanstack/preact-query'\nimport type { PersistQueryClientOptions } from '@tanstack/query-persist-client-core'\nimport type {\n OmitKeyof,\n QueryClientProviderProps,\n} from '@tanstack/preact-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): VNode => {\n const [isRestoring, setIsRestoring] = useState(true)\n const refs = useRef({ persistOptions, onSuccess, onError })\n const didRestore = useRef(false)\n\n useEffect(() => {\n refs.current = { persistOptions, onSuccess, onError }\n })\n\n 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":["import { useEffect, useRef, useState } from 'preact/hooks'\nimport type { VNode } from 'preact'\n\nimport {\n persistQueryClientRestore,\n persistQueryClientSubscribe,\n} from '@tanstack/query-persist-client-core'\nimport {\n IsRestoringProvider,\n QueryClientProvider,\n} from '@tanstack/preact-query'\nimport type { PersistQueryClientOptions } from '@tanstack/query-persist-client-core'\nimport type {\n OmitKeyof,\n QueryClientProviderProps,\n} from '@tanstack/preact-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): VNode => {\n const [isRestoring, setIsRestoring] = useState(true)\n const refs = useRef({ persistOptions, onSuccess, onError })\n const didRestore = useRef(false)\n\n useEffect(() => {\n refs.current = { persistOptions, onSuccess, onError }\n })\n\n 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":";;;;;AAuBA,MAAa,8BAA8B,EACzC,UACA,gBACA,WACA,SACA,GAAG,YACyC;CAC5C,MAAM,CAAC,aAAa,kBAAkB,SAAS,IAAI;CACnD,MAAM,OAAO,OAAO;EAAE;EAAgB;EAAW;CAAQ,CAAC;CAC1D,MAAM,aAAa,OAAO,KAAK;CAE/B,gBAAgB;EACd,KAAK,UAAU;GAAE;GAAgB;GAAW;EAAQ;CACtD,CAAC;CAED,gBAAgB;EACd,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,62 +1,46 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let preact_hooks = require("preact/hooks");
|
|
3
|
+
let _tanstack_query_persist_client_core = require("@tanstack/query-persist-client-core");
|
|
4
|
+
let _tanstack_preact_query = require("@tanstack/preact-query");
|
|
5
|
+
let preact_jsx_runtime = require("preact/jsx-runtime");
|
|
6
|
+
//#region src/PersistQueryClientProvider.tsx
|
|
7
|
+
const PersistQueryClientProvider = ({ children, persistOptions, onSuccess, onError, ...props }) => {
|
|
8
|
+
const [isRestoring, setIsRestoring] = (0, preact_hooks.useState)(true);
|
|
9
|
+
const refs = (0, preact_hooks.useRef)({
|
|
10
|
+
persistOptions,
|
|
11
|
+
onSuccess,
|
|
12
|
+
onError
|
|
13
|
+
});
|
|
14
|
+
const didRestore = (0, preact_hooks.useRef)(false);
|
|
15
|
+
(0, preact_hooks.useEffect)(() => {
|
|
16
|
+
refs.current = {
|
|
17
|
+
persistOptions,
|
|
18
|
+
onSuccess,
|
|
19
|
+
onError
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
(0, preact_hooks.useEffect)(() => {
|
|
23
|
+
const options = {
|
|
24
|
+
...refs.current.persistOptions,
|
|
25
|
+
queryClient: props.client
|
|
26
|
+
};
|
|
27
|
+
if (!didRestore.current) {
|
|
28
|
+
didRestore.current = true;
|
|
29
|
+
(0, _tanstack_query_persist_client_core.persistQueryClientRestore)(options).then(() => refs.current.onSuccess?.()).catch(() => refs.current.onError?.()).finally(() => {
|
|
30
|
+
setIsRestoring(false);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return isRestoring ? void 0 : (0, _tanstack_query_persist_client_core.persistQueryClientSubscribe)(options);
|
|
34
|
+
}, [props.client, isRestoring]);
|
|
35
|
+
return /* @__PURE__ */ (0, preact_jsx_runtime.jsx)(_tanstack_preact_query.QueryClientProvider, {
|
|
36
|
+
...props,
|
|
37
|
+
children: /* @__PURE__ */ (0, preact_jsx_runtime.jsx)(_tanstack_preact_query.IsRestoringProvider, {
|
|
38
|
+
value: isRestoring,
|
|
39
|
+
children
|
|
40
|
+
})
|
|
41
|
+
});
|
|
9
42
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
43
|
+
//#endregion
|
|
44
|
+
exports.PersistQueryClientProvider = PersistQueryClientProvider;
|
|
19
45
|
|
|
20
|
-
// src/PersistQueryClientProvider.tsx
|
|
21
|
-
var PersistQueryClientProvider_exports = {};
|
|
22
|
-
__export(PersistQueryClientProvider_exports, {
|
|
23
|
-
PersistQueryClientProvider: () => PersistQueryClientProvider
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(PersistQueryClientProvider_exports);
|
|
26
|
-
var import_hooks = require("preact/hooks");
|
|
27
|
-
var import_query_persist_client_core = require("@tanstack/query-persist-client-core");
|
|
28
|
-
var import_preact_query = require("@tanstack/preact-query");
|
|
29
|
-
var import_jsx_runtime = require("preact/jsx-runtime");
|
|
30
|
-
var PersistQueryClientProvider = ({
|
|
31
|
-
children,
|
|
32
|
-
persistOptions,
|
|
33
|
-
onSuccess,
|
|
34
|
-
onError,
|
|
35
|
-
...props
|
|
36
|
-
}) => {
|
|
37
|
-
const [isRestoring, setIsRestoring] = (0, import_hooks.useState)(true);
|
|
38
|
-
const refs = (0, import_hooks.useRef)({ persistOptions, onSuccess, onError });
|
|
39
|
-
const didRestore = (0, import_hooks.useRef)(false);
|
|
40
|
-
(0, import_hooks.useEffect)(() => {
|
|
41
|
-
refs.current = { persistOptions, onSuccess, onError };
|
|
42
|
-
});
|
|
43
|
-
(0, import_hooks.useEffect)(() => {
|
|
44
|
-
const options = {
|
|
45
|
-
...refs.current.persistOptions,
|
|
46
|
-
queryClient: props.client
|
|
47
|
-
};
|
|
48
|
-
if (!didRestore.current) {
|
|
49
|
-
didRestore.current = true;
|
|
50
|
-
(0, import_query_persist_client_core.persistQueryClientRestore)(options).then(() => refs.current.onSuccess?.()).catch(() => refs.current.onError?.()).finally(() => {
|
|
51
|
-
setIsRestoring(false);
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
return isRestoring ? void 0 : (0, import_query_persist_client_core.persistQueryClientSubscribe)(options);
|
|
55
|
-
}, [props.client, isRestoring]);
|
|
56
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_preact_query.QueryClientProvider, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_preact_query.IsRestoringProvider, { value: isRestoring, children }) });
|
|
57
|
-
};
|
|
58
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
59
|
-
0 && (module.exports = {
|
|
60
|
-
PersistQueryClientProvider
|
|
61
|
-
});
|
|
62
46
|
//# sourceMappingURL=PersistQueryClientProvider.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/PersistQueryClientProvider.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'preact/hooks'\nimport type { VNode } from 'preact'\n\nimport {\n persistQueryClientRestore,\n persistQueryClientSubscribe,\n} from '@tanstack/query-persist-client-core'\nimport {\n IsRestoringProvider,\n QueryClientProvider,\n} from '@tanstack/preact-query'\nimport type { PersistQueryClientOptions } from '@tanstack/query-persist-client-core'\nimport type {\n OmitKeyof,\n QueryClientProviderProps,\n} from '@tanstack/preact-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): VNode => {\n const [isRestoring, setIsRestoring] = useState(true)\n const refs = useRef({ persistOptions, onSuccess, onError })\n const didRestore = useRef(false)\n\n useEffect(() => {\n refs.current = { persistOptions, onSuccess, onError }\n })\n\n 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":["useState","useRef","persistQueryClientSubscribe","QueryClientProvider","IsRestoringProvider"],"sources":["../../src/PersistQueryClientProvider.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'preact/hooks'\nimport type { VNode } from 'preact'\n\nimport {\n persistQueryClientRestore,\n persistQueryClientSubscribe,\n} from '@tanstack/query-persist-client-core'\nimport {\n IsRestoringProvider,\n QueryClientProvider,\n} from '@tanstack/preact-query'\nimport type { PersistQueryClientOptions } from '@tanstack/query-persist-client-core'\nimport type {\n OmitKeyof,\n QueryClientProviderProps,\n} from '@tanstack/preact-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): VNode => {\n const [isRestoring, setIsRestoring] = useState(true)\n const refs = useRef({ persistOptions, onSuccess, onError })\n const didRestore = useRef(false)\n\n useEffect(() => {\n refs.current = { persistOptions, onSuccess, onError }\n })\n\n 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":";;;;;;AAuBA,MAAa,8BAA8B,EACzC,UACA,gBACA,WACA,SACA,GAAG,YACyC;CAC5C,MAAM,CAAC,aAAa,mBAAA,GAAkBA,aAAAA,SAAAA,CAAS,IAAI;CACnD,MAAM,QAAA,GAAOC,aAAAA,OAAAA,CAAO;EAAE;EAAgB;EAAW;CAAQ,CAAC;CAC1D,MAAM,cAAA,GAAaA,aAAAA,OAAAA,CAAO,KAAK;CAE/B,CAAA,GAAA,aAAA,UAAA,OAAgB;EACd,KAAK,UAAU;GAAE;GAAgB;GAAW;EAAQ;CACtD,CAAC;CAED,CAAA,GAAA,aAAA,UAAA,OAAgB;EACd,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,mBAAA,IAAA,CAACC,uBAAAA,qBAAD;EAAqB,GAAI;EACvB,UAAA,iBAAA,GAAA,mBAAA,IAAA,CAACC,uBAAAA,qBAAD;GAAqB,OAAO;GAAc;EAA8B,CAAA;CACrD,CAAA;AAEzB"}
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { VNode } from "preact";
|
|
2
|
+
import { PersistQueryClientOptions } from "@tanstack/query-persist-client-core";
|
|
3
|
+
import { OmitKeyof, QueryClientProviderProps } from "@tanstack/preact-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) => VNode;
|
|
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":";;;;KAiBY,kCAAkC;EAC5C,gBAAgB,UAAU;EAC1B,kBAAkB;EAClB,gBAAgB;;cAGL,+BAA8B,UAAA,gBAAA,WAAA,YAAA,SAMxC,oCAAkC"}
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { PersistQueryClientOptions } from "@tanstack/query-persist-client-core";
|
|
2
|
+
import { OmitKeyof, QueryClientProviderProps } from "@tanstack/preact-query";
|
|
3
|
+
import { VNode } from "preact";
|
|
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) => VNode;
|
|
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":";;;;KAiBY,kCAAkC;EAC5C,gBAAgB,UAAU;EAC1B,kBAAkB;EAClB,gBAAgB;;cAGL,+BAA8B,UAAA,gBAAA,WAAA,YAAA,SAMxC,oCAAkC"}
|
|
@@ -1,43 +1,45 @@
|
|
|
1
|
-
// src/PersistQueryClientProvider.tsx
|
|
2
1
|
import { useEffect, useRef, useState } from "preact/hooks";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
persistQueryClientSubscribe
|
|
6
|
-
} from "@tanstack/query-persist-client-core";
|
|
7
|
-
import {
|
|
8
|
-
IsRestoringProvider,
|
|
9
|
-
QueryClientProvider
|
|
10
|
-
} from "@tanstack/preact-query";
|
|
2
|
+
import { persistQueryClientRestore, persistQueryClientSubscribe } from "@tanstack/query-persist-client-core";
|
|
3
|
+
import { IsRestoringProvider, QueryClientProvider } from "@tanstack/preact-query";
|
|
11
4
|
import { jsx } from "preact/jsx-runtime";
|
|
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
|
-
|
|
5
|
+
//#region src/PersistQueryClientProvider.tsx
|
|
6
|
+
const PersistQueryClientProvider = ({ children, persistOptions, onSuccess, onError, ...props }) => {
|
|
7
|
+
const [isRestoring, setIsRestoring] = useState(true);
|
|
8
|
+
const refs = useRef({
|
|
9
|
+
persistOptions,
|
|
10
|
+
onSuccess,
|
|
11
|
+
onError
|
|
12
|
+
});
|
|
13
|
+
const didRestore = useRef(false);
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
refs.current = {
|
|
16
|
+
persistOptions,
|
|
17
|
+
onSuccess,
|
|
18
|
+
onError
|
|
19
|
+
};
|
|
20
|
+
});
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
const options = {
|
|
23
|
+
...refs.current.persistOptions,
|
|
24
|
+
queryClient: props.client
|
|
25
|
+
};
|
|
26
|
+
if (!didRestore.current) {
|
|
27
|
+
didRestore.current = true;
|
|
28
|
+
persistQueryClientRestore(options).then(() => refs.current.onSuccess?.()).catch(() => refs.current.onError?.()).finally(() => {
|
|
29
|
+
setIsRestoring(false);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
return isRestoring ? void 0 : persistQueryClientSubscribe(options);
|
|
33
|
+
}, [props.client, isRestoring]);
|
|
34
|
+
return /* @__PURE__ */ jsx(QueryClientProvider, {
|
|
35
|
+
...props,
|
|
36
|
+
children: /* @__PURE__ */ jsx(IsRestoringProvider, {
|
|
37
|
+
value: isRestoring,
|
|
38
|
+
children
|
|
39
|
+
})
|
|
40
|
+
});
|
|
42
41
|
};
|
|
42
|
+
//#endregion
|
|
43
|
+
export { PersistQueryClientProvider };
|
|
44
|
+
|
|
43
45
|
//# sourceMappingURL=PersistQueryClientProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/PersistQueryClientProvider.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'preact/hooks'\nimport type { VNode } from 'preact'\n\nimport {\n persistQueryClientRestore,\n persistQueryClientSubscribe,\n} from '@tanstack/query-persist-client-core'\nimport {\n IsRestoringProvider,\n QueryClientProvider,\n} from '@tanstack/preact-query'\nimport type { PersistQueryClientOptions } from '@tanstack/query-persist-client-core'\nimport type {\n OmitKeyof,\n QueryClientProviderProps,\n} from '@tanstack/preact-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): VNode => {\n const [isRestoring, setIsRestoring] = useState(true)\n const refs = useRef({ persistOptions, onSuccess, onError })\n const didRestore = useRef(false)\n\n useEffect(() => {\n refs.current = { persistOptions, onSuccess, onError }\n })\n\n 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":["import { useEffect, useRef, useState } from 'preact/hooks'\nimport type { VNode } from 'preact'\n\nimport {\n persistQueryClientRestore,\n persistQueryClientSubscribe,\n} from '@tanstack/query-persist-client-core'\nimport {\n IsRestoringProvider,\n QueryClientProvider,\n} from '@tanstack/preact-query'\nimport type { PersistQueryClientOptions } from '@tanstack/query-persist-client-core'\nimport type {\n OmitKeyof,\n QueryClientProviderProps,\n} from '@tanstack/preact-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): VNode => {\n const [isRestoring, setIsRestoring] = useState(true)\n const refs = useRef({ persistOptions, onSuccess, onError })\n const didRestore = useRef(false)\n\n useEffect(() => {\n refs.current = { persistOptions, onSuccess, onError }\n })\n\n 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":";;;;;AAuBA,MAAa,8BAA8B,EACzC,UACA,gBACA,WACA,SACA,GAAG,YACyC;CAC5C,MAAM,CAAC,aAAa,kBAAkB,SAAS,IAAI;CACnD,MAAM,OAAO,OAAO;EAAE;EAAgB;EAAW;CAAQ,CAAC;CAC1D,MAAM,aAAa,OAAO,KAAK;CAE/B,gBAAgB;EACd,KAAK,UAAU;GAAE;GAAgB;GAAW;EAAQ;CACtD,CAAC;CAED,gBAAgB;EACd,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/preact-query-persist-client",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.102.0",
|
|
4
4
|
"description": "Preact bindings to work with persisters in TanStack/preact-query",
|
|
5
5
|
"author": "tannerlinsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"!src/__tests__"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@tanstack/query-persist-client-core": "5.
|
|
42
|
+
"@tanstack/query-persist-client-core": "5.102.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@preact/preset-vite": "^2.10.2",
|
|
@@ -47,31 +47,29 @@
|
|
|
47
47
|
"eslint-config-preact": "^2.0.0",
|
|
48
48
|
"npm-run-all2": "^5.0.0",
|
|
49
49
|
"preact": "^10.28.0",
|
|
50
|
-
"typescript": "
|
|
50
|
+
"typescript": "6.0.3",
|
|
51
51
|
"typescript-eslint": "^8.54.0",
|
|
52
|
-
"@tanstack/preact-query": "5.
|
|
52
|
+
"@tanstack/preact-query": "5.102.0",
|
|
53
53
|
"@tanstack/query-test-utils": "0.0.0"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"preact": "^10.0.0",
|
|
57
|
-
"@tanstack/preact-query": "^5.
|
|
57
|
+
"@tanstack/preact-query": "^5.102.0"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
60
|
"clean": "premove ./build ./coverage ./dist-ts",
|
|
61
61
|
"compile": "tsc --build",
|
|
62
62
|
"test:eslint": "eslint --concurrency=auto ./src",
|
|
63
63
|
"test:types": "npm-run-all --serial test:types:*",
|
|
64
|
-
"test:types:ts54": "node ../../node_modules/typescript54/lib/tsc.js --build tsconfig.legacy.json",
|
|
65
|
-
"test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js --build tsconfig.legacy.json",
|
|
66
64
|
"test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --build tsconfig.legacy.json",
|
|
67
65
|
"test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --build tsconfig.legacy.json",
|
|
68
66
|
"test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js --build tsconfig.legacy.json",
|
|
69
67
|
"test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js --build tsconfig.legacy.json",
|
|
70
68
|
"test:types:tscurrent": "tsc --build",
|
|
71
|
-
"test:types:
|
|
69
|
+
"test:types:ts70": "node ../../node_modules/typescript70/lib/tsc.js --build",
|
|
72
70
|
"test:lib": "vitest --retry=3",
|
|
73
71
|
"test:lib:dev": "pnpm run test:lib --watch",
|
|
74
72
|
"test:build": "publint --strict && attw --pack",
|
|
75
|
-
"build": "
|
|
73
|
+
"build": "tsdown --tsconfig tsconfig.prod.json"
|
|
76
74
|
}
|
|
77
75
|
}
|
|
@@ -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/preact-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/preact-query';
|
|
20
|
-
import { removeOldestQuery } from '@tanstack/query-persist-client-core';
|
|
21
|
-
import { StoragePersisterOptions } from '@tanstack/query-persist-client-core';
|
|
22
|
-
import type { VNode } from 'preact';
|
|
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) => VNode;
|
|
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/preact-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/preact-query';
|
|
20
|
-
import { removeOldestQuery } from '@tanstack/query-persist-client-core';
|
|
21
|
-
import { StoragePersisterOptions } from '@tanstack/query-persist-client-core';
|
|
22
|
-
import type { VNode } from 'preact';
|
|
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) => VNode;
|
|
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/preact-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/preact-query';
|
|
20
|
-
import { removeOldestQuery } from '@tanstack/query-persist-client-core';
|
|
21
|
-
import { StoragePersisterOptions } from '@tanstack/query-persist-client-core';
|
|
22
|
-
import type { VNode } from 'preact';
|
|
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) => VNode;
|
|
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/preact-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/preact-query';
|
|
20
|
-
import { removeOldestQuery } from '@tanstack/query-persist-client-core';
|
|
21
|
-
import { StoragePersisterOptions } from '@tanstack/query-persist-client-core';
|
|
22
|
-
import type { VNode } from 'preact';
|
|
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) => VNode;
|
|
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":[]}
|