1.0.2 • Published 2 years ago

ei-fetch v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

✅ Zero dependencies (react, react-dom as peer deps)

✅ Use hooks

Documentation

Short example of use

import { useFetch } from "ei-fetch";

const fetchUsersList = {
  url: 'https://jsonplaceholder.typicode.com/users'
};

export const UsersListContainer = () => {
  const { data, isError, isLoading } = useFetch(fetchUsersList);

  if (isLoading) return <h1>isLoading</h1>;
  if (isError) return <h1>isErroro</h1>;

  return <UsersList isLoading={isLoading} isError={isError} users={data} />;
};

Typescript support

Inspirations