@bellawatt/use-debounce-effect
v1.2.0
Published
useEffect hook that debounces the effect
Downloads
2
Readme
use-debounce-effect
useEffect hook that debounces the effect
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.