use-stop-typing
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

useStopTyping

React hook for running callback when input stops.

Installation

npm install use-stop-typing

Usage

In this example, 'console.log("Update")' will be executed 2000ms after the input is stopped!

import { useRef } from 'react';
import { useStopTyping } from 'use-stop-typing';

export default () => {
  const ref = useRef<HTMLInputElement>(null);
  useStopTyping(ref, () => console.log('Update'), 2000);

  return (
    <input type="text" ref={ref} />
  )
}

LICENSE

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i use-stop-typing

Weekly Downloads

6

Version

1.1.0

License

MIT

Unpacked Size

7.5 kB

Total Files

8

Last publish

Collaborators

  • duglaser