File tree Expand file tree Collapse file tree 1 file changed +26
-4
lines changed Expand file tree Collapse file tree 1 file changed +26
-4
lines changed Original file line number Diff line number Diff line change 11import { GecutQueue } from '@gecut/utilities/queue.js' ;
2- import { untilMS } from '@gecut/utilities/wait/wait.js' ;
2+ import { untilEvent , untilMS } from '@gecut/utilities/wait/wait.js' ;
33
4- const queue = new GecutQueue ( 'demo' , 500 ) ;
4+ const queue = new GecutQueue ( 'demo' , 1500 ) ;
55
6- queue . push ( untilMS ( 5000 ) , 'ms1' ) ;
6+ const f1 = queue . push ( untilMS ( 5000 ) , 'f1' ) ;
7+ const f2 = queue . push ( untilEvent ( document . body , 'dblclick' ) , 'f2' ) ;
8+ let timer = 0 ;
79
8- console . log ( 'fuck' )
10+ setInterval ( ( ) => {
11+ console . clear ( ) ;
12+
13+ console . log ( timer ) ;
14+
15+ console . log ( {
16+ id : f1 . id ,
17+ isRunning : queue . isRunning ( f1 . id ) ,
18+ isFinished : queue . isFinished ( f1 . id ) ,
19+ value : queue . getValue ( f1 . id ) ,
20+ } ) ;
21+
22+ console . log ( {
23+ id : f2 . id ,
24+ isRunning : queue . isRunning ( f2 . id ) ,
25+ isFinished : queue . isFinished ( f2 . id ) ,
26+ value : queue . getValue ( f2 . id ) ,
27+ } ) ;
28+
29+ timer ++ ;
30+ } , 1000 ) ;
You can’t perform that action at this time.
0 commit comments