2.0.6 • Published 3 months ago

@jhenbertnpm/use-fetch v2.0.6

Weekly downloads
-
License
MIT
Repository
-
Last release
3 months ago

Quickstart

Using the custom hook

const { data, isLoaded, error } = useFetch<DataType[]>({
    fetchFn: async () => {
      const response = await fetch(url);
      const data: DataType[] = await response.json();
      return data;
    },
    initialData: [],
  });

In the example above, I use the fetch() API. You can also use Axios or any other promise-based http client.

2.0.6

3 months ago

2.0.5

5 months ago

2.0.4

6 months ago

2.0.3

6 months ago

2.0.2

6 months ago

2.0.1

6 months ago

2.0.0

6 months ago