deno.land / x / prayers@v1.6.0 / examples / playground.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { Observable, defer, repeat } from 'rxjs'
const randNum = () => Math.floor(Math.random() * 10) + 1
const myObs = () => { return defer(() => { let delay = randNum() console.log('It will be delayed by', delay, ' secounds') delay = delay * 1000 // convert to ms return new Observable((subscriber) => { subscriber.next('hey there') subscriber.complete() }).pipe(repeat({ delay })) })}
myObs().subscribe((val) => { console.log('this is the val', val)})
prayers

Version Info

Tagged at
7 months ago