1.0.3 • Published 10 months ago

use-fetch-error v1.0.3

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

Use-fetch-error

A library for error handling with error, result tuples using a useFetchError() function.

Example usage:

(async () => {
  const validURL = "https://jsonplaceholder.typicode.com/posts/1";
  const invalidURL = "https://url-invalid.com";

  const [error, data] = await useFetchError(invalidURL);

  if (error) {
    console.error("An error occurred:", error);
  } else {
    console.log("Data received:", data);
  }
})();
1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago