That one is actually pretty easy in JavaScript - in the past I've implemented the same sort of behavior using async generators.
(I also like Go's time.Ticker behavior quite a lot)
(I also like Go's time.Ticker behavior quite a lot)
The one I slapped together works, but this one is better (fixes issues with actually stopping it properly): https://github.com/joeycumines/generator-ticker
On NPM as generator-ticker.
Hurt my head a little, but it's fixed now, and I'm at least moderately confident it's correct - unit tested the behavior step by step using `ts-chan`, actually. Will probably use that test as another example use case.