Skip to content

roeib/awesome-hooks-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

er-custom-hooks

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published