useTimeout
Calls the given function after timer elapses
Arguments:
callback
– function that will be called after the timer elapses
delay
– number of milliseconds the timer should wait before the specified function is executed
options: { autoInvoke }
- determines whether the timer should be started on mount, defaults to false
Return object:
start
- starts the timer
clear
– cancels the timer