@tanstack/solid-query-persist-client 5.94.4 → 5.94.5
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/_tsup-dts-rollup.d.cts +84 -0
- package/build/_tsup-dts-rollup.d.ts +84 -0
- package/build/dev.cjs +49 -0
- package/build/dev.d.cts +21 -0
- package/build/dev.d.ts +21 -0
- package/build/dev.js +43 -0
- package/build/index.cjs +49 -0
- package/build/index.d.cts +21 -0
- package/build/index.d.ts +21 -0
- package/build/index.js +43 -0
- package/package.json +4 -4
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { AsyncStorage } from '@tanstack/query-persist-client-core';
|
|
2
|
+
import { experimental_createQueryPersister } from '@tanstack/query-persist-client-core';
|
|
3
|
+
import type { JSX } from 'solid-js';
|
|
4
|
+
import { MaybePromise } from '@tanstack/query-persist-client-core';
|
|
5
|
+
import type { OmitKeyof } from '@tanstack/solid-query';
|
|
6
|
+
import { Options } from 'tsup';
|
|
7
|
+
import { PersistedClient } from '@tanstack/query-persist-client-core';
|
|
8
|
+
import { PersistedQuery } from '@tanstack/query-persist-client-core';
|
|
9
|
+
import { PersistedQueryClientRestoreOptions } from '@tanstack/query-persist-client-core';
|
|
10
|
+
import { PersistedQueryClientSaveOptions } from '@tanstack/query-persist-client-core';
|
|
11
|
+
import { Persister } from '@tanstack/query-persist-client-core';
|
|
12
|
+
import { PERSISTER_KEY_PREFIX } from '@tanstack/query-persist-client-core';
|
|
13
|
+
import { persistQueryClient } from '@tanstack/query-persist-client-core';
|
|
14
|
+
import { PersistQueryClientOptions } from '@tanstack/query-persist-client-core';
|
|
15
|
+
import { persistQueryClientRestore } from '@tanstack/query-persist-client-core';
|
|
16
|
+
import { PersistQueryClientRootOptions } from '@tanstack/query-persist-client-core';
|
|
17
|
+
import { persistQueryClientSave } from '@tanstack/query-persist-client-core';
|
|
18
|
+
import { persistQueryClientSubscribe } from '@tanstack/query-persist-client-core';
|
|
19
|
+
import { PersistRetryer } from '@tanstack/query-persist-client-core';
|
|
20
|
+
import { Promisable } from '@tanstack/query-persist-client-core';
|
|
21
|
+
import type { QueryClientProviderProps } from '@tanstack/solid-query';
|
|
22
|
+
import { removeOldestQuery } from '@tanstack/query-persist-client-core';
|
|
23
|
+
import { StoragePersisterOptions } from '@tanstack/query-persist-client-core';
|
|
24
|
+
import { UserConfig } from 'vite';
|
|
25
|
+
|
|
26
|
+
export { AsyncStorage }
|
|
27
|
+
|
|
28
|
+
export declare const default_alias: any[];
|
|
29
|
+
|
|
30
|
+
export declare const default_alias_1: any[];
|
|
31
|
+
|
|
32
|
+
export declare const default_alias_2: Options | Options[] | ((overrideOptions: Options) => Options | Options[] | Promise<Options | Options[]>);
|
|
33
|
+
|
|
34
|
+
export declare const default_alias_3: UserConfig;
|
|
35
|
+
|
|
36
|
+
export { experimental_createQueryPersister }
|
|
37
|
+
|
|
38
|
+
export { MaybePromise }
|
|
39
|
+
|
|
40
|
+
export { PersistedClient }
|
|
41
|
+
|
|
42
|
+
export { PersistedQuery }
|
|
43
|
+
|
|
44
|
+
export { PersistedQueryClientRestoreOptions }
|
|
45
|
+
|
|
46
|
+
export { PersistedQueryClientSaveOptions }
|
|
47
|
+
|
|
48
|
+
export { Persister }
|
|
49
|
+
|
|
50
|
+
export { PERSISTER_KEY_PREFIX }
|
|
51
|
+
|
|
52
|
+
export { persistQueryClient }
|
|
53
|
+
|
|
54
|
+
export { PersistQueryClientOptions }
|
|
55
|
+
|
|
56
|
+
declare const PersistQueryClientProvider: (props: PersistQueryClientProviderProps) => JSX.Element;
|
|
57
|
+
export { PersistQueryClientProvider }
|
|
58
|
+
export { PersistQueryClientProvider as PersistQueryClientProvider_alias_1 }
|
|
59
|
+
|
|
60
|
+
declare type PersistQueryClientProviderProps = QueryClientProviderProps & {
|
|
61
|
+
persistOptions: OmitKeyof<PersistQueryClientOptions, 'queryClient'>;
|
|
62
|
+
onSuccess?: () => void;
|
|
63
|
+
onError?: () => void;
|
|
64
|
+
};
|
|
65
|
+
export { PersistQueryClientProviderProps }
|
|
66
|
+
export { PersistQueryClientProviderProps as PersistQueryClientProviderProps_alias_1 }
|
|
67
|
+
|
|
68
|
+
export { persistQueryClientRestore }
|
|
69
|
+
|
|
70
|
+
export { PersistQueryClientRootOptions }
|
|
71
|
+
|
|
72
|
+
export { persistQueryClientSave }
|
|
73
|
+
|
|
74
|
+
export { persistQueryClientSubscribe }
|
|
75
|
+
|
|
76
|
+
export { PersistRetryer }
|
|
77
|
+
|
|
78
|
+
export { Promisable }
|
|
79
|
+
|
|
80
|
+
export { removeOldestQuery }
|
|
81
|
+
|
|
82
|
+
export { StoragePersisterOptions }
|
|
83
|
+
|
|
84
|
+
export { }
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { AsyncStorage } from '@tanstack/query-persist-client-core';
|
|
2
|
+
import { experimental_createQueryPersister } from '@tanstack/query-persist-client-core';
|
|
3
|
+
import type { JSX } from 'solid-js';
|
|
4
|
+
import { MaybePromise } from '@tanstack/query-persist-client-core';
|
|
5
|
+
import type { OmitKeyof } from '@tanstack/solid-query';
|
|
6
|
+
import { Options } from 'tsup';
|
|
7
|
+
import { PersistedClient } from '@tanstack/query-persist-client-core';
|
|
8
|
+
import { PersistedQuery } from '@tanstack/query-persist-client-core';
|
|
9
|
+
import { PersistedQueryClientRestoreOptions } from '@tanstack/query-persist-client-core';
|
|
10
|
+
import { PersistedQueryClientSaveOptions } from '@tanstack/query-persist-client-core';
|
|
11
|
+
import { Persister } from '@tanstack/query-persist-client-core';
|
|
12
|
+
import { PERSISTER_KEY_PREFIX } from '@tanstack/query-persist-client-core';
|
|
13
|
+
import { persistQueryClient } from '@tanstack/query-persist-client-core';
|
|
14
|
+
import { PersistQueryClientOptions } from '@tanstack/query-persist-client-core';
|
|
15
|
+
import { persistQueryClientRestore } from '@tanstack/query-persist-client-core';
|
|
16
|
+
import { PersistQueryClientRootOptions } from '@tanstack/query-persist-client-core';
|
|
17
|
+
import { persistQueryClientSave } from '@tanstack/query-persist-client-core';
|
|
18
|
+
import { persistQueryClientSubscribe } from '@tanstack/query-persist-client-core';
|
|
19
|
+
import { PersistRetryer } from '@tanstack/query-persist-client-core';
|
|
20
|
+
import { Promisable } from '@tanstack/query-persist-client-core';
|
|
21
|
+
import type { QueryClientProviderProps } from '@tanstack/solid-query';
|
|
22
|
+
import { removeOldestQuery } from '@tanstack/query-persist-client-core';
|
|
23
|
+
import { StoragePersisterOptions } from '@tanstack/query-persist-client-core';
|
|
24
|
+
import { UserConfig } from 'vite';
|
|
25
|
+
|
|
26
|
+
export { AsyncStorage }
|
|
27
|
+
|
|
28
|
+
export declare const default_alias: any[];
|
|
29
|
+
|
|
30
|
+
export declare const default_alias_1: any[];
|
|
31
|
+
|
|
32
|
+
export declare const default_alias_2: Options | Options[] | ((overrideOptions: Options) => Options | Options[] | Promise<Options | Options[]>);
|
|
33
|
+
|
|
34
|
+
export declare const default_alias_3: UserConfig;
|
|
35
|
+
|
|
36
|
+
export { experimental_createQueryPersister }
|
|
37
|
+
|
|
38
|
+
export { MaybePromise }
|
|
39
|
+
|
|
40
|
+
export { PersistedClient }
|
|
41
|
+
|
|
42
|
+
export { PersistedQuery }
|
|
43
|
+
|
|
44
|
+
export { PersistedQueryClientRestoreOptions }
|
|
45
|
+
|
|
46
|
+
export { PersistedQueryClientSaveOptions }
|
|
47
|
+
|
|
48
|
+
export { Persister }
|
|
49
|
+
|
|
50
|
+
export { PERSISTER_KEY_PREFIX }
|
|
51
|
+
|
|
52
|
+
export { persistQueryClient }
|
|
53
|
+
|
|
54
|
+
export { PersistQueryClientOptions }
|
|
55
|
+
|
|
56
|
+
declare const PersistQueryClientProvider: (props: PersistQueryClientProviderProps) => JSX.Element;
|
|
57
|
+
export { PersistQueryClientProvider }
|
|
58
|
+
export { PersistQueryClientProvider as PersistQueryClientProvider_alias_1 }
|
|
59
|
+
|
|
60
|
+
declare type PersistQueryClientProviderProps = QueryClientProviderProps & {
|
|
61
|
+
persistOptions: OmitKeyof<PersistQueryClientOptions, 'queryClient'>;
|
|
62
|
+
onSuccess?: () => void;
|
|
63
|
+
onError?: () => void;
|
|
64
|
+
};
|
|
65
|
+
export { PersistQueryClientProviderProps }
|
|
66
|
+
export { PersistQueryClientProviderProps as PersistQueryClientProviderProps_alias_1 }
|
|
67
|
+
|
|
68
|
+
export { persistQueryClientRestore }
|
|
69
|
+
|
|
70
|
+
export { PersistQueryClientRootOptions }
|
|
71
|
+
|
|
72
|
+
export { persistQueryClientSave }
|
|
73
|
+
|
|
74
|
+
export { persistQueryClientSubscribe }
|
|
75
|
+
|
|
76
|
+
export { PersistRetryer }
|
|
77
|
+
|
|
78
|
+
export { Promisable }
|
|
79
|
+
|
|
80
|
+
export { removeOldestQuery }
|
|
81
|
+
|
|
82
|
+
export { StoragePersisterOptions }
|
|
83
|
+
|
|
84
|
+
export { }
|
package/build/dev.cjs
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var queryPersistClientCore = require('@tanstack/query-persist-client-core');
|
|
4
|
+
var web = require('solid-js/web');
|
|
5
|
+
var solidJs = require('solid-js');
|
|
6
|
+
var solidQuery = require('@tanstack/solid-query');
|
|
7
|
+
|
|
8
|
+
// src/index.ts
|
|
9
|
+
exports.PersistQueryClientProvider = (props) => {
|
|
10
|
+
const [isRestoring, setIsRestoring] = solidJs.createSignal(true);
|
|
11
|
+
const options = solidJs.createMemo(() => ({
|
|
12
|
+
...props.persistOptions,
|
|
13
|
+
queryClient: props.client
|
|
14
|
+
}));
|
|
15
|
+
solidJs.createEffect(() => {
|
|
16
|
+
setIsRestoring(true);
|
|
17
|
+
queryPersistClientCore.persistQueryClientRestore(options()).then(() => props.onSuccess?.()).catch(() => props.onError?.()).finally(() => {
|
|
18
|
+
setIsRestoring(false);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
solidJs.createEffect(() => {
|
|
22
|
+
let unsubscribe = () => {
|
|
23
|
+
};
|
|
24
|
+
if (!isRestoring()) {
|
|
25
|
+
unsubscribe = queryPersistClientCore.persistQueryClientSubscribe(options());
|
|
26
|
+
}
|
|
27
|
+
solidJs.onCleanup(() => unsubscribe());
|
|
28
|
+
});
|
|
29
|
+
return web.createComponent(solidQuery.QueryClientProvider, {
|
|
30
|
+
get client() {
|
|
31
|
+
return props.client;
|
|
32
|
+
},
|
|
33
|
+
get children() {
|
|
34
|
+
return web.createComponent(solidQuery.IsRestoringProvider, {
|
|
35
|
+
value: isRestoring,
|
|
36
|
+
get children() {
|
|
37
|
+
return props.children;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
Object.keys(queryPersistClientCore).forEach(function (k) {
|
|
45
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
get: function () { return queryPersistClientCore[k]; }
|
|
48
|
+
});
|
|
49
|
+
});
|
package/build/dev.d.cts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export { persistQueryClientRestore } from './_tsup-dts-rollup.cjs';
|
|
2
|
+
export { persistQueryClientSave } from './_tsup-dts-rollup.cjs';
|
|
3
|
+
export { persistQueryClientSubscribe } from './_tsup-dts-rollup.cjs';
|
|
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';
|
package/build/dev.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export { persistQueryClientRestore } from './_tsup-dts-rollup.js';
|
|
2
|
+
export { persistQueryClientSave } from './_tsup-dts-rollup.js';
|
|
3
|
+
export { persistQueryClientSubscribe } from './_tsup-dts-rollup.js';
|
|
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';
|
package/build/dev.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { persistQueryClientRestore, persistQueryClientSubscribe } from '@tanstack/query-persist-client-core';
|
|
2
|
+
export * from '@tanstack/query-persist-client-core';
|
|
3
|
+
import { createComponent } from 'solid-js/web';
|
|
4
|
+
import { createSignal, createMemo, createEffect, onCleanup } from 'solid-js';
|
|
5
|
+
import { QueryClientProvider, IsRestoringProvider } from '@tanstack/solid-query';
|
|
6
|
+
|
|
7
|
+
// src/index.ts
|
|
8
|
+
var PersistQueryClientProvider = (props) => {
|
|
9
|
+
const [isRestoring, setIsRestoring] = createSignal(true);
|
|
10
|
+
const options = createMemo(() => ({
|
|
11
|
+
...props.persistOptions,
|
|
12
|
+
queryClient: props.client
|
|
13
|
+
}));
|
|
14
|
+
createEffect(() => {
|
|
15
|
+
setIsRestoring(true);
|
|
16
|
+
persistQueryClientRestore(options()).then(() => props.onSuccess?.()).catch(() => props.onError?.()).finally(() => {
|
|
17
|
+
setIsRestoring(false);
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
createEffect(() => {
|
|
21
|
+
let unsubscribe = () => {
|
|
22
|
+
};
|
|
23
|
+
if (!isRestoring()) {
|
|
24
|
+
unsubscribe = persistQueryClientSubscribe(options());
|
|
25
|
+
}
|
|
26
|
+
onCleanup(() => unsubscribe());
|
|
27
|
+
});
|
|
28
|
+
return createComponent(QueryClientProvider, {
|
|
29
|
+
get client() {
|
|
30
|
+
return props.client;
|
|
31
|
+
},
|
|
32
|
+
get children() {
|
|
33
|
+
return createComponent(IsRestoringProvider, {
|
|
34
|
+
value: isRestoring,
|
|
35
|
+
get children() {
|
|
36
|
+
return props.children;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { PersistQueryClientProvider };
|
package/build/index.cjs
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var queryPersistClientCore = require('@tanstack/query-persist-client-core');
|
|
4
|
+
var web = require('solid-js/web');
|
|
5
|
+
var solidJs = require('solid-js');
|
|
6
|
+
var solidQuery = require('@tanstack/solid-query');
|
|
7
|
+
|
|
8
|
+
// src/index.ts
|
|
9
|
+
exports.PersistQueryClientProvider = (props) => {
|
|
10
|
+
const [isRestoring, setIsRestoring] = solidJs.createSignal(true);
|
|
11
|
+
const options = solidJs.createMemo(() => ({
|
|
12
|
+
...props.persistOptions,
|
|
13
|
+
queryClient: props.client
|
|
14
|
+
}));
|
|
15
|
+
solidJs.createEffect(() => {
|
|
16
|
+
setIsRestoring(true);
|
|
17
|
+
queryPersistClientCore.persistQueryClientRestore(options()).then(() => props.onSuccess?.()).catch(() => props.onError?.()).finally(() => {
|
|
18
|
+
setIsRestoring(false);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
solidJs.createEffect(() => {
|
|
22
|
+
let unsubscribe = () => {
|
|
23
|
+
};
|
|
24
|
+
if (!isRestoring()) {
|
|
25
|
+
unsubscribe = queryPersistClientCore.persistQueryClientSubscribe(options());
|
|
26
|
+
}
|
|
27
|
+
solidJs.onCleanup(() => unsubscribe());
|
|
28
|
+
});
|
|
29
|
+
return web.createComponent(solidQuery.QueryClientProvider, {
|
|
30
|
+
get client() {
|
|
31
|
+
return props.client;
|
|
32
|
+
},
|
|
33
|
+
get children() {
|
|
34
|
+
return web.createComponent(solidQuery.IsRestoringProvider, {
|
|
35
|
+
value: isRestoring,
|
|
36
|
+
get children() {
|
|
37
|
+
return props.children;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
Object.keys(queryPersistClientCore).forEach(function (k) {
|
|
45
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
get: function () { return queryPersistClientCore[k]; }
|
|
48
|
+
});
|
|
49
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export { persistQueryClientRestore } from './_tsup-dts-rollup.cjs';
|
|
2
|
+
export { persistQueryClientSave } from './_tsup-dts-rollup.cjs';
|
|
3
|
+
export { persistQueryClientSubscribe } from './_tsup-dts-rollup.cjs';
|
|
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';
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export { persistQueryClientRestore } from './_tsup-dts-rollup.js';
|
|
2
|
+
export { persistQueryClientSave } from './_tsup-dts-rollup.js';
|
|
3
|
+
export { persistQueryClientSubscribe } from './_tsup-dts-rollup.js';
|
|
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';
|
package/build/index.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { persistQueryClientRestore, persistQueryClientSubscribe } from '@tanstack/query-persist-client-core';
|
|
2
|
+
export * from '@tanstack/query-persist-client-core';
|
|
3
|
+
import { createComponent } from 'solid-js/web';
|
|
4
|
+
import { createSignal, createMemo, createEffect, onCleanup } from 'solid-js';
|
|
5
|
+
import { QueryClientProvider, IsRestoringProvider } from '@tanstack/solid-query';
|
|
6
|
+
|
|
7
|
+
// src/index.ts
|
|
8
|
+
var PersistQueryClientProvider = (props) => {
|
|
9
|
+
const [isRestoring, setIsRestoring] = createSignal(true);
|
|
10
|
+
const options = createMemo(() => ({
|
|
11
|
+
...props.persistOptions,
|
|
12
|
+
queryClient: props.client
|
|
13
|
+
}));
|
|
14
|
+
createEffect(() => {
|
|
15
|
+
setIsRestoring(true);
|
|
16
|
+
persistQueryClientRestore(options()).then(() => props.onSuccess?.()).catch(() => props.onError?.()).finally(() => {
|
|
17
|
+
setIsRestoring(false);
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
createEffect(() => {
|
|
21
|
+
let unsubscribe = () => {
|
|
22
|
+
};
|
|
23
|
+
if (!isRestoring()) {
|
|
24
|
+
unsubscribe = persistQueryClientSubscribe(options());
|
|
25
|
+
}
|
|
26
|
+
onCleanup(() => unsubscribe());
|
|
27
|
+
});
|
|
28
|
+
return createComponent(QueryClientProvider, {
|
|
29
|
+
get client() {
|
|
30
|
+
return props.client;
|
|
31
|
+
},
|
|
32
|
+
get children() {
|
|
33
|
+
return createComponent(IsRestoringProvider, {
|
|
34
|
+
value: isRestoring,
|
|
35
|
+
get children() {
|
|
36
|
+
return props.children;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { PersistQueryClientProvider };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/solid-query-persist-client",
|
|
3
|
-
"version": "5.94.
|
|
3
|
+
"version": "5.94.5",
|
|
4
4
|
"description": "Solid.js bindings to work with persisters in TanStack/solid-query",
|
|
5
5
|
"author": "tannerlinsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"!src/__tests__"
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@tanstack/query-persist-client-core": "5.94.
|
|
49
|
+
"@tanstack/query-persist-client-core": "5.94.5"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@solidjs/testing-library": "^0.8.10",
|
|
@@ -55,11 +55,11 @@
|
|
|
55
55
|
"tsup-preset-solid": "^2.2.0",
|
|
56
56
|
"vite-plugin-solid": "^2.11.6",
|
|
57
57
|
"@tanstack/query-test-utils": "0.0.0",
|
|
58
|
-
"@tanstack/solid-query": "5.94.
|
|
58
|
+
"@tanstack/solid-query": "5.94.5"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"solid-js": "^1.6.0",
|
|
62
|
-
"@tanstack/solid-query": "^5.94.
|
|
62
|
+
"@tanstack/solid-query": "^5.94.5"
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
65
|
"clean": "premove ./build ./coverage ./dist-ts",
|