react-haiku
react-haiku copied to clipboard
[FEAT] Create useFetch Hook
- [ ] The useFetch hook should be able to make HTTP requests and retrieve data from a specified URL.
- [ ] The hook should provide a way to specify the HTTP method (GET, POST, PUT, DELETE, etc.) for the request.
- [ ] The hook should handle loading and error states appropriately during the HTTP request.
- [ ] When the request is successful, the hook should provide the retrieved data to the component using it.
- [ ] The hook should support passing headers and body data for requests that require additional parameters.
- [ ] It should handle cancellation of ongoing requests if the component using the hook is unmounted.
- [ ] The hook should allow for customization of the request behavior, such as setting timeouts or handling redirects.
- [ ] It should provide a way to manually trigger the request, in addition to automatically triggering it on component mount.
- [ ] The hook should support handling multiple concurrent requests independently.
- [ ] It should allow for customization of error handling, such as handling specific HTTP error codes differently.