Hullo JS
Search…
interval
import { interval } from '@hullo/core'
Returns an Observable that emits current time (returned by Date.now) with a frequency provided as first and only argument. First argument should be a number and will be interpreted as the amount of time that should separate each message.
1
import { interval, map } from '@hullo/core';
2
​
3
interval(1000).pipe(
4
map(t => new Date(t).toString())
5
).subscribe({
6
next(time) { console.log('Current time:', time); }
7
});
Copied!
Last modified 2yr ago
Copy link