rehooks/ideas

useFetch

ergenekonyigit opened this issue ยท 5 comments

pretty nice

Configurable datatype?

I think this will cache the data based on the URL? That means it should only be used for GET requests.

I think it should at least mimic Fetch API, e. g. accept URL and options object.

jxom commented

This hook is kind of implicitly achieved in #24. I think it would be nicer if we left the 'fetcher' implementation up to the user. The reason why I say this is because we might want to use the kind of behaviour this hook has for different kinds of things like an SDK, a different HTTP client like Axios, or even a promise in general. Let me know your thoughts!