It's Dan Abramov's declarative setInterval hook but the callback function can return a cleanup function that gets called when the interval stops
https://overreacted.io/making-setinterval-declarative-with-react-hooks/
function to be called. Can return another function that runs as cleanup when delay changes or component unmounts
delay
number of milliseconds between calls
Generated using TypeDoc
It's Dan Abramov's declarative setInterval hook but the callback function can return a cleanup function that gets called when the interval stops
https://overreacted.io/making-setinterval-declarative-with-react-hooks/