0.1.3 • Published 2 years ago

@sjblurton/use-timeout v0.1.3

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

useTimeout

useTime takes 2 arguments, the first is the function you would like to run after the the delay, the second is the delay in milliseconds. It returns a object with clear, and rest functions to clear, or reset the timeout.

To install the hook...

npm i @sjblurton/use-timeout

yarn add @sjblurton/use-timeout

To call the hook...

const { clear, reset } = useTimeout(() => callback(), 1000)

To clear timeout...

clear()

To reset timeout...

reset()

links

GitHub Repo: https://github.com/sjblurton/use-timeout NPM: https://www.npmjs.com/package/@sjblurton/use-timeout