aloha-vue 1.0.319 → 1.0.320
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -42,9 +42,15 @@ export function setHeaderParams({ headerParams = {} } = {}) {
|
|
|
42
42
|
export function abortHttp({
|
|
43
43
|
all = false,
|
|
44
44
|
abortGroup,
|
|
45
|
+
excludeAbortGroup,
|
|
45
46
|
}) {
|
|
47
|
+
const EXCLUDE_ABORT_GROUP_OBJ = getExcludeAbortGroup({ excludeAbortGroup });
|
|
48
|
+
|
|
46
49
|
if (all) {
|
|
47
50
|
forEach(abortGroupController, (abortController, abortKey) => {
|
|
51
|
+
if (EXCLUDE_ABORT_GROUP_OBJ[abortKey]) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
48
54
|
abortController.abort();
|
|
49
55
|
if (abortKey !== "_global") {
|
|
50
56
|
delete abortGroupController[abortKey];
|
|
@@ -58,6 +64,9 @@ export function abortHttp({
|
|
|
58
64
|
abortGroupList = abortGroup;
|
|
59
65
|
}
|
|
60
66
|
forEach(abortGroupList, abortKey => {
|
|
67
|
+
if (EXCLUDE_ABORT_GROUP_OBJ[abortKey]) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
61
70
|
if (abortGroupController[abortKey]) {
|
|
62
71
|
abortGroupController[abortKey].abort();
|
|
63
72
|
if (abortKey !== "_global") {
|
|
@@ -485,3 +494,17 @@ function getAbortGroupSignal({ abortGroup, abortable } = {}) {
|
|
|
485
494
|
}
|
|
486
495
|
return abortGroupController._global.signal;
|
|
487
496
|
}
|
|
497
|
+
|
|
498
|
+
function getExcludeAbortGroup({ excludeAbortGroup }) {
|
|
499
|
+
const EXCLUDE_ABORT_GROUP_OBJ = {};
|
|
500
|
+
if (excludeAbortGroup) {
|
|
501
|
+
if (isString(excludeAbortGroup)) {
|
|
502
|
+
EXCLUDE_ABORT_GROUP_OBJ[excludeAbortGroup] = true;
|
|
503
|
+
} else if (isArray(excludeAbortGroup)) {
|
|
504
|
+
forEach(excludeAbortGroup, abortGroupkey => {
|
|
505
|
+
EXCLUDE_ABORT_GROUP_OBJ[abortGroupkey] = true;
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
return EXCLUDE_ABORT_GROUP_OBJ;
|
|
510
|
+
}
|