@jdthornton/usetimeout
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

@jdthornton/usetimeout

npm (scoped) npm bundle size (minified)

React timeout hook.

Install

$ npm install @jdthornton/usetimeout

Usage

import useTimout from "@jdthornton/usetimeout";

function App({ isSet, handleTimeoutEnd }){

  // 'handleTimeoutEnd' will be called at the end of 1000s if isSet is true
  useTimout(handleTimeoutEnd, isSet ? 1000 : null)

  return null
}

Readme

Keywords

none

Package Sidebar

Install

npm i @jdthornton/usetimeout

Weekly Downloads

0

Version

1.0.4

License

MIT

Unpacked Size

3.15 kB

Total Files

5

Last publish

Collaborators

  • jdthornton