rax-use-fetch

1.0.0 • Public • Published

rax-use-fetch

import { createElement } from 'rax';
import useFetch from 'rax-use-fetch';
 
function Example() {
  const [data, error] = useFetch('https://httpbin.org/get');
  if (error) {
    return <p>error</p>
  } else if (data) {
    return <p>{data.foo}</p>
  } else {
    return <p>loading</p>
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i rax-use-fetch

Weekly Downloads

0

Version

1.0.0

License

BSD-3-Clause

Unpacked Size

1.72 kB

Total Files

4

Last publish

Collaborators

  • yuanyan
  • rax-publisher