react-haiku
react-haiku copied to clipboard
[FEAT] Create useMutation hook
- [ ] The useMutation hook should be able to perform a PUT request to update data on the server using the provided API URL.
- [ ] It should allow customization of the request payload and headers to send along with the PUT request.
- [ ] The hook should handle loading and error states during the mutation request, providing appropriate feedback to the component using it.
- [ ] The useMutation hook should support specifying success and error callback functions to handle the response from the server.
- [ ] It should provide a way to track the mutation status, such as a boolean flag indicating whether the mutation is in progress or has completed.
- [ ] The hook should handle cancellation of the mutation request if the component using the hook is unmounted.
- [ ] It should handle proper error handling, such as detecting network failures or server errors and providing appropriate error messages or fallback behavior.
- [ ] The useMutation hook should support passing additional options, such as timeouts or retry mechanisms, to customize the behavior of the mutation request.