Version: v3.6.0
#
@rooks/use-interval#
setInterval 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 |