@syncot/util
Advanced tools
Comparing version 0.0.11 to 0.0.12
@@ -18,4 +18,3 @@ import { EmitterInterface, SyncOtEmitter } from './event'; | ||
/** | ||
* If a task is already scheduled or running, it is canceled first. | ||
* Runs the task now. | ||
* Runs the task now, unless it is already running or scheduled. | ||
* If it fails, emits an `error` event and schedules a retry. | ||
@@ -22,0 +21,0 @@ * If it succeeds, emits a `done` event. |
@@ -34,7 +34,8 @@ import { SyncOtEmitter } from './event'; | ||
this.assertNotDestroyed(); | ||
this.cancel(); | ||
this.runNow(); | ||
if (this.timeout === undefined && this.promise === undefined) { | ||
this.runNow(); | ||
} | ||
} | ||
cancel() { | ||
if (this.timeout) { | ||
if (this.timeout !== undefined) { | ||
clearTimeout(this.timeout); | ||
@@ -41,0 +42,0 @@ this.timeout = undefined; |
{ | ||
"name": "@syncot/util", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"description": "A collection of utilities required by other @syncot modules.", | ||
@@ -34,3 +34,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "70a5ae5f5ddb507b3b7ced84f0e0a591f25db627" | ||
"gitHead": "81aeded1a96d3cbb999520d46507127db819c0fb" | ||
} |
40196
17