Home > @lndsld/react-hooks > useInterval
Let callback automatically run with specified time interval
Signature:
declare function useInterval(callback: EventCallback<[]>, initialDelay?: number): IntervalAPI;
| Parameter | Type | Description |
|---|---|---|
| callback | EventCallback<[]> | callback to run |
| initialDelay | number | (Optional) delay to start interval on hook mount |
Returns:
interval API