@jdthornton/usetimeout
v1.0.4
Published
React timeout hook
Downloads
5
Readme
@jdthornton/usetimeout
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
}