Get an async iterable that yields on an interval until aborted.
The amount of time to wait between intervals, in milliseconds
Optional
The options for the timer
An async iterable that yields on each intervals
let controller = new AbortController();for await (let _ of interval(1000, { signal: controller.signal })) { // Do something every second until aborted} Copy
let controller = new AbortController();for await (let _ of interval(1000, { signal: controller.signal })) { // Do something every second until aborted}
Get an async iterable that yields on an interval until aborted.