0.0.5 • Published 3 years ago

use-async-api v0.0.5

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

How to use

const fetchData = () => fetch("https://filesamples.com/samples/code/json/sample2.json").then((resp) => resp.json());

function ShowData() {
  const [triggerFetch, loading, data, error] = useAPI(fetchData);

  async function handleClick(provider: string) {
    const { data } = await triggerFetch();
  }
  
  ...
}
0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago