UseInterval as a Custom Hook

React

https://overreacted.io/making-setinterval-declarative-with-react-hooks/

Dan Abramov teaches how to combine useRef() and useEffect() to create a new useInterval() hook