sync-queues
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -59,3 +59,3 @@ "use strict"; | ||
} | ||
var poll = function () { | ||
var dispatchNextTask = function () { | ||
if (!running) { | ||
@@ -76,5 +76,3 @@ var release = queue.shift(); | ||
queue.push(turn.releaser); | ||
if (queue.length > 0) { | ||
poll(); | ||
} | ||
dispatchNextTask(); | ||
return [4 /*yield*/, turn.promise]; | ||
@@ -94,3 +92,2 @@ case 1: | ||
result = _a.sent(); | ||
; | ||
return [2 /*return*/, result]; | ||
@@ -103,3 +100,3 @@ case 4: | ||
} | ||
poll(); | ||
dispatchNextTask(); | ||
return [7 /*endfinally*/]; | ||
@@ -106,0 +103,0 @@ case 5: return [2 /*return*/]; |
{ | ||
"name": "sync-queues", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Utility for synchronizing async code", | ||
@@ -17,6 +17,6 @@ "main": "lib/index.js", | ||
"@types/jest": "24.0.11", | ||
"jest": "24.5.0", | ||
"ts-jest": "24.0.0", | ||
"typescript": "3.3.4000" | ||
"jest": "24.8.0", | ||
"ts-jest": "24.0.2", | ||
"typescript": "3.5.1" | ||
} | ||
} |
@@ -18,3 +18,3 @@ export const noop = () => {}; | ||
let running = false; | ||
let timeoutId: NodeJS.Timeout | null = null; | ||
let timeoutId: ReturnType<typeof setTimeout> | null = null; | ||
if (taskTimeout < 0) { throw taskTimeoutValueError; } | ||
@@ -43,3 +43,3 @@ | ||
}); | ||
const result = await Promise.race([task(), timeout]);; | ||
const result = await Promise.race<T>([task(), timeout]); | ||
return result; | ||
@@ -46,0 +46,0 @@ } finally { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11540
281