1.0.3 • Published 3 years ago

use-debounce-hook v1.0.3

Weekly downloads
14
License
MIT
Repository
github
Last release
3 years ago

use-debounce-hook

Node.js CI NPM npm JavaScript Style Guide

Install

npm install --save use-debounce-hook

Usage

import React, { useState } from 'react';
import { useDebounce } from 'use-debounce';

const App = () => {
  const [value, setValue] = useState('');
  const text = useDebounce(value);
  //ou const text = useDebounce(value, 1000); timeout configuration
  return (
    <div>
      <div>
        <input
          type="text"
          value={value}
          onChange={(e) => setValue(e.target.value)}
        />
      </div>
      <div>{text}</div>
    </div>
  );
};
export default App;

License

MIT © fulviocanducci


Example on-line

useDebounce example on-line


This hook is created using create-react-hook.

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago