File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1
1
import { Predicate , Consumer , Action } from './util'
2
2
import { iterableBy , entries } from './util'
3
+ import is from './is_test'
3
4
4
5
export type ElementConfig = Consumer < Element >
5
6
@@ -19,13 +20,14 @@ export function waitsElement(e: Element, op: Action) {
19
20
}
20
21
}
21
22
22
- const scheduleQueue : Array < Array < any > > = [ ] ;
23
+ const scheduleQueues : { [ name : string ] : Array < Array < any > > } = { } ;
23
24
const schedulePlace : any = ( window as any ) ;
24
25
export function schedule ( name : string , ...args : any ) {
26
+ let scheduleQueue = scheduleQueues [ name ] ;
25
27
let found : Function = schedulePlace [ name ] ;
26
- if ( found != undefined ) {
27
- while ( scheduleQueue . length != 0 ) found ( ...scheduleQueue . shift ( ) ) ;
28
- found ( ...args ) ;
28
+ if ( is . someValue ( found ) ) {
29
+ while ( is . notEmpty ( scheduleQueue ) ) found ( ...scheduleQueue . shift ( ) ) ;
30
+ /*and then call*/ found ( ...args ) ;
29
31
}
30
32
else scheduleQueue . push ( args ) ;
31
33
}
You can’t perform that action at this time.
0 commit comments