React utility hook that calls a function at a specified interval.
The interval can be paused by setting the delay to null.
The useInterval
hook is based on Dan Abramov's article on overreacted.io (https://overreacted.io/making-setinterval-declarative-with-react-hooks/).
Run the following command: