react-async-hook
react-async-hook copied to clipboard
React hook to handle any async operation in React components, and prevent race conditions
When receiving `onSuccess`/`onError` parameters externally, it's very common to handle it as optional, as in the following example: ```tsx type Props = { onSuccess?: (data: ...) => void; }; const...
Fixes #86
In `executeAsyncOperation` the promise rejection scenario is not properly handled. It captures the error, saves it in state, but then it propagates further and causes exceptions in the codebase. I...
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6. Commits 7efb22a 1.2.6 ef88b93 security notice for additional prototype pollution issue c2b9819 isConstructorOrProto adapted from PR bc8ecee test from prototype pollution PR See full...
I'm trying to use this in place of react's `useCallback()`, and was wondering if a dependency array is required as I don't see one in the signature. Based on the...
This also removes the merge property and probably breaks [this functionality](https://github.com/slorber/react-async-hook/tree/f8569186fbf77607b0f6d46a62639cd838b4d966#how-can-i-keep-previous-results-available-while-a-new-request-is-pending) This is more of an idea than anything else, feel free to close this PR. I'd like more guarantees...
Bumps [ajv](https://github.com/ajv-validator/ajv) from 6.10.0 to 6.12.6. Release notes Sourced from ajv's releases. v6.12.6 Fix performance issue of "url" format. v6.12.5 Fix uri scheme validation (@ChALkeR). Fix boolean schemas with strictKeywords...
Bumps [ajv](https://github.com/ajv-validator/ajv) from 6.10.0 to 6.12.6. Release notes Sourced from ajv's releases. v6.12.6 Fix performance issue of "url" format. v6.12.5 Fix uri scheme validation (@ChALkeR). Fix boolean schemas with strictKeywords...
Hi, it's possible to show one example using axios and return de status code? I'm new working with react and i don't figure it out how to get the status...
I see there are some options like `onSuccess`, `onError` which allow us to do something that has side-effects, but no one like`onLoad` when the fetching is started. It might be...