fun-dispatcher
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -13,2 +13,3 @@ interface Job { | ||
schedule(key: string, runner: () => void, delay: number): void; | ||
runNext(): void; | ||
delete(key: string): boolean; | ||
@@ -15,0 +16,0 @@ flush(): void; |
@@ -64,2 +64,8 @@ "use strict"; | ||
} | ||
runNext() { | ||
if (this.timeouts.length > 0) { | ||
const tm = this.timeouts.shift(); | ||
this.timeoutItem(tm); | ||
} | ||
} | ||
delete(key) { | ||
@@ -66,0 +72,0 @@ const res = super.delete(key); |
{ | ||
"name": "fun-dispatcher", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Tiny ES6 class to run functions after a given delay. Uses just on timer at any time and setImmediate to launch", | ||
@@ -5,0 +5,0 @@ "types": "./dist/index.d.ts", |
6345
106