lndsld

Home > @lndsld/react-hooks > useInterval

useInterval() function

Let callback automatically run with specified time interval

Signature:

declare function useInterval(callback: EventCallback<[]>, initialDelay?: number): IntervalAPI;

Parameters

Parameter Type Description
callback EventCallback<[]> callback to run
initialDelay number (Optional) delay to start interval on hook mount

Returns:

IntervalAPI

interval API