use-timeout
Calls function after given timeout
Import
Source
Docs
Package
Usage
Random value:
API
Arguments:
callback
– function that will be called after the timer elapsesdelay
– number of milliseconds the timer should wait before the specified function is executedoptions: { autoInvoke }
- determines whether the timer should be started on mount, defaults to false
Return object:
start
- starts the timerclear
– cancels the timer