Version: v4.10.0
use-interval
#
AboutsetInterval hook for React.
#
Installation#
Importing the hook#
Usage#
ArgumentsArgument | Type | Description | Default value |
---|---|---|---|
callback | function | Function be invoked after each interval duration | undefined |
intervalDuration | number | Duration in milliseconds after which callback is invoked | undefined |
startImmediate | boolean | Should the timer start immediately or no | false |
#
Returned ObjectReturned object attributes | Type | Description |
---|---|---|
start | function | Start the interval |
stop | function | Stop the interval |
intervalId | intervalId | IntervalId of the interval |
#
Join Bhargav's discord serverYou can click on the floating discord icon at the bottom right of the screen and talk to us in our server.