Skip to content

Commit f96b59c

Browse files
committed
Remove throwOnError from usePolling
1 parent 9f94e38 commit f96b59c

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

.changeset/bitter-cougars-enjoy.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@viamrobotics/svelte-sdk': patch
3+
---
4+
5+
Remove throwOnError from usePolling

src/lib/hooks/use-polling.svelte.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useQueryClient } from '@tanstack/svelte-query';
1+
import { CancelledError, useQueryClient } from '@tanstack/svelte-query';
22

33
/**
44
* Polls a query at an interval while waiting for
@@ -24,10 +24,7 @@ export function usePolling(
2424
}
2525

2626
const poll = async () => {
27-
await queryClient.refetchQueries(
28-
{ queryKey: key },
29-
{ throwOnError: true }
30-
);
27+
await queryClient.refetchQueries({ queryKey: key });
3128
timeoutId = setTimeout(poll, currentInterval);
3229
};
3330

0 commit comments

Comments
 (0)