@flaque/use-timeout
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

use-timeout

License

A react-hook for accessing setTimeout without constantly resetting.

Install

yarn add @flaque/use-timeout

Usage

const [setTimeoutHook, clearTimeoutHook] = useTimeout();

setTimeoutHook(() => {
  console.log("It's been 10000 miliseconds!");
}, 10000);

// ...

clearTimeoutHook(); // Stops the timeout before it happens

Readme

Keywords

none

Package Sidebar

Install

npm i @flaque/use-timeout

Weekly Downloads

2

Version

1.2.1

License

UNLICENSED

Unpacked Size

1.95 kB

Total Files

6

Last publish

Collaborators

  • flaque