@rpldy/abort
Advanced tools
Comparing version 1.1.0-rc.0 to 1.1.0-rc.1
@@ -56,4 +56,5 @@ "use strict"; | ||
const abortAll = (items, aborts, finalizeItem, options) => { | ||
const itemIds = Object.keys(items); | ||
const abortAll = (items, aborts, queue, finalizeItem, options) => { | ||
//$FlowIssue[incompatible-type] - no flat | ||
const itemIds = Object.values(queue).flat(); | ||
const isFastAbort = getIsFastAbortNeeded(itemIds.length, options.fastAbortThreshold); | ||
@@ -76,5 +77,5 @@ | ||
const abortBatch = (batch, batchOptions, aborts, finalizeItem, options) => { | ||
const abortBatch = (batch, batchOptions, aborts, queue, finalizeItem, options) => { | ||
const threshold = batchOptions.fastAbortThreshold === 0 ? 0 : batchOptions.fastAbortThreshold || options.fastAbortThreshold; | ||
const isFastAbort = getIsFastAbortNeeded(batch.items.length, threshold); | ||
const isFastAbort = getIsFastAbortNeeded(queue[batch.id].length, threshold); | ||
@@ -81,0 +82,0 @@ _shared.logger.debugLog(`abort: doing abort-batch on: ${batch.id} (${isFastAbort ? "fast" : "normal"} abort)`); |
@@ -44,4 +44,5 @@ import { FILE_STATES, logger } from "@rpldy/shared"; | ||
const abortAll = (items, aborts, finalizeItem, options) => { | ||
const itemIds = Object.keys(items); | ||
const abortAll = (items, aborts, queue, finalizeItem, options) => { | ||
//$FlowIssue[incompatible-type] - no flat | ||
const itemIds = Object.values(queue).flat(); | ||
const isFastAbort = getIsFastAbortNeeded(itemIds.length, options.fastAbortThreshold); | ||
@@ -61,5 +62,5 @@ logger.debugLog(`abort: doing abort-all (${isFastAbort ? "fast" : "normal"} abort)`); | ||
const abortBatch = (batch, batchOptions, aborts, finalizeItem, options) => { | ||
const abortBatch = (batch, batchOptions, aborts, queue, finalizeItem, options) => { | ||
const threshold = batchOptions.fastAbortThreshold === 0 ? 0 : batchOptions.fastAbortThreshold || options.fastAbortThreshold; | ||
const isFastAbort = getIsFastAbortNeeded(batch.items.length, threshold); | ||
const isFastAbort = getIsFastAbortNeeded(queue[batch.id].length, threshold); | ||
logger.debugLog(`abort: doing abort-batch on: ${batch.id} (${isFastAbort ? "fast" : "normal"} abort)`); | ||
@@ -66,0 +67,0 @@ |
{ | ||
"version": "1.1.0-rc.0", | ||
"version": "1.1.0-rc.1", | ||
"name": "@rpldy/abort", | ||
@@ -26,5 +26,5 @@ "description": "adds the capability to abort/cancel running & pending uploads", | ||
"dependencies": { | ||
"@rpldy/raw-uploader": "^1.1.0-rc.0", | ||
"@rpldy/shared": "^1.1.0-rc.0", | ||
"@rpldy/simple-state": "^1.1.0-rc.0" | ||
"@rpldy/raw-uploader": "^1.1.0-rc.1", | ||
"@rpldy/shared": "^1.1.0-rc.1", | ||
"@rpldy/simple-state": "^1.1.0-rc.1" | ||
}, | ||
@@ -37,3 +37,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "a80346f4acdf01b889077da006328610142fa42e" | ||
"gitHead": "3bf60849416fa42f05bef7918f48e3ba866258ff" | ||
} |
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
11602
221