0.0.2 • Published 3 years ago

er-custom-hooks v0.0.2

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

er-custom-hooks

Made with create-react-library

NPM JavaScript Style Guide

Getting Started

npm install --save er-custom-hooks

Basic Usage

import React, {useEffect} from 'react'
import {useAsync, AsyncWrapper} from 'er-custom-hooks'
import getExampleReasources from 'er-custom-hooks-http'

const Example = () => {
  const {executeFunction, status, value} = useAsync(getExampleReasources)

  useEffect(() => {
    executeFunction()
  }, [])

  return <AsyncWrapper status={status}>
      <div>{value}</div>
    </AsyncWrapper>
}

export default Example