function heartBeat(fn, tick = 3e3) {
  const id = setInterval(() => fn(), tick)
  return () => {
    clearInterval(id)
    return () => heartBeat(fn, tick)
  }
}
Tick a function on a scehdule
@param {*} fn - Function to execute
@param {number} tick - Delay in milliseconds
@returns