I was looking into how I can gracefully resume a timer that might have been stopped and thought this would have been a natural choice, but noticed the function didn't return anything. This is helpful for pausing and resuming mid-way through an animation. If I restarted the timer, it will likely interrupt the timer and restart the animation.
const hello = (elapsedTime) => console.log("hello world", elapsedTime)
const timer = d3.timer(hello)
setTImeout(() => {
const stoppedTime = timer.stop()
setTImeout(() => {
timer.restart(hello, null, stoppedTime)
}, 5000)
}, 5000)
Is there a way to achieve something similar?