@tanstack/solid-query-persist-client 5.72.2 → 5.73.3

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/dev.cjs CHANGED
@@ -14,12 +14,8 @@ exports.PersistQueryClientProvider = (props) => {
14
14
  }));
15
15
  solidJs.createEffect(() => {
16
16
  setIsRestoring(true);
17
- queryPersistClientCore.persistQueryClientRestore(options()).then(async () => {
18
- try {
19
- await props.onSuccess?.();
20
- } finally {
21
- setIsRestoring(false);
22
- }
17
+ queryPersistClientCore.persistQueryClientRestore(options()).then(() => props.onSuccess?.()).catch(() => props.onError?.()).finally(() => {
18
+ setIsRestoring(false);
23
19
  });
24
20
  });
25
21
  solidJs.createEffect(() => {
package/build/dev.js CHANGED
@@ -13,12 +13,8 @@ var PersistQueryClientProvider = (props) => {
13
13
  }));
14
14
  createEffect(() => {
15
15
  setIsRestoring(true);
16
- persistQueryClientRestore(options()).then(async () => {
17
- try {
18
- await props.onSuccess?.();
19
- } finally {
20
- setIsRestoring(false);
21
- }
16
+ persistQueryClientRestore(options()).then(() => props.onSuccess?.()).catch(() => props.onError?.()).finally(() => {
17
+ setIsRestoring(false);
22
18
  });
23
19
  });
24
20
  createEffect(() => {
package/build/index.cjs CHANGED
@@ -14,12 +14,8 @@ exports.PersistQueryClientProvider = (props) => {
14
14
  }));
15
15
  solidJs.createEffect(() => {
16
16
  setIsRestoring(true);
17
- queryPersistClientCore.persistQueryClientRestore(options()).then(async () => {
18
- try {
19
- await props.onSuccess?.();
20
- } finally {
21
- setIsRestoring(false);
22
- }
17
+ queryPersistClientCore.persistQueryClientRestore(options()).then(() => props.onSuccess?.()).catch(() => props.onError?.()).finally(() => {
18
+ setIsRestoring(false);
23
19
  });
24
20
  });
25
21
  solidJs.createEffect(() => {
package/build/index.d.cts CHANGED
@@ -6,6 +6,7 @@ import { JSX } from 'solid-js';
6
6
  type PersistQueryClientProviderProps = QueryClientProviderProps & {
7
7
  persistOptions: OmitKeyof<PersistQueryClientOptions, 'queryClient'>;
8
8
  onSuccess?: () => void;
9
+ onError?: () => void;
9
10
  };
10
11
  declare const PersistQueryClientProvider: (props: PersistQueryClientProviderProps) => JSX.Element;
11
12
 
package/build/index.d.ts CHANGED
@@ -6,6 +6,7 @@ import { JSX } from 'solid-js';
6
6
  type PersistQueryClientProviderProps = QueryClientProviderProps & {
7
7
  persistOptions: OmitKeyof<PersistQueryClientOptions, 'queryClient'>;
8
8
  onSuccess?: () => void;
9
+ onError?: () => void;
9
10
  };
10
11
  declare const PersistQueryClientProvider: (props: PersistQueryClientProviderProps) => JSX.Element;
11
12
 
package/build/index.js CHANGED
@@ -13,12 +13,8 @@ var PersistQueryClientProvider = (props) => {
13
13
  }));
14
14
  createEffect(() => {
15
15
  setIsRestoring(true);
16
- persistQueryClientRestore(options()).then(async () => {
17
- try {
18
- await props.onSuccess?.();
19
- } finally {
20
- setIsRestoring(false);
21
- }
16
+ persistQueryClientRestore(options()).then(() => props.onSuccess?.()).catch(() => props.onError?.()).finally(() => {
17
+ setIsRestoring(false);
22
18
  });
23
19
  });
24
20
  createEffect(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/solid-query-persist-client",
3
- "version": "5.72.2",
3
+ "version": "5.73.3",
4
4
  "description": "Solid.js bindings to work with persisters in TanStack/solid-query",
5
5
  "author": "tannerlinsley",
6
6
  "license": "MIT",
@@ -45,7 +45,7 @@
45
45
  "!src/__tests__"
46
46
  ],
47
47
  "dependencies": {
48
- "@tanstack/query-persist-client-core": "5.72.2"
48
+ "@tanstack/query-persist-client-core": "5.73.3"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@solidjs/testing-library": "^0.8.10",
@@ -53,11 +53,11 @@
53
53
  "solid-js": "^1.9.5",
54
54
  "tsup-preset-solid": "^2.2.0",
55
55
  "vite-plugin-solid": "^2.11.6",
56
- "@tanstack/solid-query": "5.72.2"
56
+ "@tanstack/solid-query": "5.73.3"
57
57
  },
58
58
  "peerDependencies": {
59
59
  "solid-js": "^1.6.0",
60
- "@tanstack/solid-query": "^5.72.2"
60
+ "@tanstack/solid-query": "^5.73.3"
61
61
  },
62
62
  "scripts": {}
63
63
  }
@@ -11,6 +11,7 @@ import type { JSX } from 'solid-js'
11
11
  export type PersistQueryClientProviderProps = QueryClientProviderProps & {
12
12
  persistOptions: OmitKeyof<PersistQueryClientOptions, 'queryClient'>
13
13
  onSuccess?: () => void
14
+ onError?: () => void
14
15
  }
15
16
 
16
17
  export const PersistQueryClientProvider = (
@@ -25,13 +26,12 @@ export const PersistQueryClientProvider = (
25
26
 
26
27
  createEffect(() => {
27
28
  setIsRestoring(true)
28
- persistQueryClientRestore(options()).then(async () => {
29
- try {
30
- await props.onSuccess?.()
31
- } finally {
29
+ persistQueryClientRestore(options())
30
+ .then(() => props.onSuccess?.())
31
+ .catch(() => props.onError?.())
32
+ .finally(() => {
32
33
  setIsRestoring(false)
33
- }
34
- })
34
+ })
35
35
  })
36
36
 
37
37
  createEffect(() => {