-
-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
TanStack Pacer version
0.19.4
Framework/Library version
React 18
Describe the bug and the steps to reproduce it
Some async functions have incorrect inferred types.
const debouncedCallback = useAsyncDebouncedCallback(
async (value: string): Promise<string> => {
return "fake network result " + value
},
{
wait: 500,
}
)
// debouncedCallback: (value: string) => Promise<Promise<string>>
const throttledCallback = useAsyncThrottledCallback(
async (value: string): Promise<string> => {
return "fake network result " + value
},
{
wait: 500,
}
)
// throttledCallback: (value: string) => Promise<Promise<string>>
const rateLimitedCallback = useAsyncRateLimitedCallback(
async (value: string): Promise<string> => {
return "fake network result " + value
},
{
limit: 5,
window: 60000,
windowType: 'sliding',
}
)
// rateLimitedCallback: (value: string) => Promise<Promise<string>>Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
.
Screenshots or Videos (Optional)
No response
Do you intend to try to help solve this bug with your own PR?
Yes, I am also opening a PR that solves the problem along side this issue
Terms & Code of Conduct
- I agree to follow this project's Code of Conduct
- I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels