@bellawatt/use-debounce-effect

1.2.0 • Public • Published

use-debounce-effect

useEffect hook that debounces the effect

NPM JavaScript Style Guide

Install

npm install --save use-debounce-effect

Usage

import React, { useState } from 'react'
import axios from 'axios';
import { useDebounceEffect } from '@bellawatt/react-hooks'

const DebounceEffectExample = () => {
  const [value, setValue] = useState('');

  useDebounceEffect(() => {
    someSlowFunction();
  }, 1000, [value]));

  return (
    <div>
      <input value={value} onChange={e => setValue(e.currentTarget.value)} />
    </div>
  )
}

License

MIT © bellawatt


This hook is created using create-react-hook.

Readme

Keywords

none

Package Sidebar

Install

npm i @bellawatt/use-debounce-effect

Weekly Downloads

0

Version

1.2.0

License

MIT

Unpacked Size

1.32 MB

Total Files

22

Last publish

Collaborators

  • brandonshar
  • bknoles