react-async-hook
react-async-hook copied to clipboard
React hook to handle any async operation in React components, and prevent race conditions
We just managed to DDOS our entire site, because we were missing an empty dependency array in the `useAsync()`, which resulted in endless refresh loop with microseconds between refreshes. I...
I'm looking for the `useAsyncCallback` with the `signal` param passed to handle multiple taps in quick succession. I realise I can disable the button when you click it, but that's...
It seems that we don't have API reference documentation. The examples in the README are thorough, but an API Reference section like [SWR](https://swr.vercel.app/docs/options) or [React Query](https://react-query.tanstack.com/reference/useQuery) would help us quickly...
First off, thanks for your work this project. Super lightweight and I'm sure is going to simplify my code a lot! 🙇 🙏 --- ## Question about default strategy for...
Hi We have strict tslint/eslint rules and noticed that the react-async-hook code produces these warnings. ``` Line 126: React Hook useCallback has a missing dependency: 'options'. Either include it or...
Hi Sebastien, thanks for adding onSuccess hooks! Just noting a couple things that could improve the usage flexibility. - often there is a need to know not just the result...
I have a project using vite 5 (rollup 4.6), and I get warnings related to react-async-hook when building my project: ``` vite v5.0.6 building for production... node_modules/react-async-hook/dist/react-async-hook.cjs.development.js (25:24) A comment...
Adds a cancel function to the result of useAsyncAbortable() ``` const result = useAsyncAbortable(async (signal: AbortSignal) => {}, []); result.cancel(); ``` This aborts the AbortSignal that is passed into the...
Hi! I want to allow users to cancel running fetch requests in the UI. Even though the useAsyncAbortable sounds like the right place, it only handles aborting internally, and there...
I read #6 and then #7. I saw that handling streams / observables doesn't make sense here, there are other hooks. My situation is a little different. I'm using nostr,...