1.0.9 • Published 2 years ago

use-deeebounce v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

use-deeebounce

A React hook for debouncing values in functional components.

Installation

You can install the package using npm:

yarn add use-deeebounce
# or
npm install use-deeebounce

Usage

import React, { useState } from 'react';

//import useDebouce as a named export
import { useDebounce } from 'use-deeebounce';

export const Input = () => {
  const [inputValue, setInputValue] = useState('');

  // Set the duration for debouncing and provide the hook with a string value to debounce.
  const debouncedInputValue = useDebounce(inputValue, 5 * 100);

  return (
    <div>
      <label>Input:</label>
      <input type="text" value={inputValue} onChange={(e)=>setInputValue(e.target.value)} />
      {/* see the debounced query here */}
      <p>Debounced Value: {debouncedInputValue}</p>
    </div>
  );
};
1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago