A hook that will run a callback function on a given interval. If the interval
changes, the existing callback is cancelled and a new one is set up with the
new interval.
Parameters
callback: (() => void | Promise<void>)
The callback to run.
(): void | Promise<void>
Returns void | Promise<void>
interval: null | number
The interval to run it on. If null it will cancel any existing
callback and no longer run.
A hook that will run a callback function on a given interval. If the interval changes, the existing callback is cancelled and a new one is set up with the new interval.