Calls a callback immediately and then repeatedly at the given interval.
Interval in milliseconds between invocations
The function to call
Optional
Optional widget; the interval is removed when the widget is destroyed
The GLib source ID (can be used with GLib.source_remove)
GLib.source_remove
const id = interval(1000, () => console.log('tick')); Copy
const id = interval(1000, () => console.log('tick'));
Calls a callback immediately and then repeatedly at the given interval.