The counter `retryCount` in the `onErrorRetry` is not incremented
mrfratello opened this issue · 3 comments
mrfratello commented
The following code always returns 1
and the retryCount
parameter
const [query] = nanoquery({
fetcher: () => Promise.reject(),
onErrorRetry: ({ retryCount }) => {
console.log(`retryCount: ${retryCount}`);
return retryCount * 1_000;
},
});
P.S.: Can you export the default handler onErrorCount
? If this is done, then I will be able to set a limit on the number of repetitions of the request and leave the logic of the intervals between requests:
const [query] = nanoquery({
onErrorRetry: (params) => params.retryCount > 3 ? null : defaultOnErrorRetry(params),
});