Skip to content

Commit 5069fa2

Browse files
committed
✨ Add polyfill for AbortController
1 parent cba50e0 commit 5069fa2

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

packages/@ackee/antonio-utils/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
"scripts": {
2929
"size": "package-size es --no-cache"
3030
},
31+
"dependencies": {
32+
"abortcontroller-polyfill": "1.7.1"
33+
},
3134
"peerDependencies": {
3235
"redux-saga": "1.x"
3336
},

packages/@ackee/antonio-utils/src/saga-effects/utils/cancellableHandler.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1+
import AbortControllerPolyfill from 'abortcontroller-polyfill';
12
import { call, take, race } from 'redux-saga/effects';
23
import { CancellableHandler } from 'types';
34

45
const noop = function* () {};
56

67
export default function* cancellableHandler({ handlerArg, CANCEL, handler, onComplete = noop }: CancellableHandler) {
7-
// FIXME: add polyfill
8-
// eslint-disable-next-line compat/compat
9-
const controller = new AbortController();
8+
const controller: AbortController = new AbortControllerPolyfill();
109

1110
function* tasks() {
1211
yield call(handler, handlerArg, controller.signal);

yarn.lock

+14-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
# yarn lockfile v1
33

44

5+
6+
version "4.0.0-beta.0"
7+
resolved "https://registry.yarnpkg.com/@ackee/antonio-core/-/antonio-core-4.0.0-beta.0.tgz#4cf797c5f721bf1ae90a46b3655ee7fbc50e1aba"
8+
integrity sha512-KO1Xts7mYAmfut2ltahjZiedetwVJksrXGmjcC0UyXKfPmMHaaiU9OL8o8NJ3MBV0rQeB416wJGL+kAvS6FZ5A==
9+
dependencies:
10+
fetch-headers "^2.0.0"
11+
512
"@ackee/browserslist-config@^1.0.1":
613
version "1.0.1"
714
resolved "https://registry.yarnpkg.com/@ackee/browserslist-config/-/browserslist-config-1.0.1.tgz#5e127d76161d31bbb3c53b45a8676b4fb3c3ebf9"
@@ -2598,6 +2605,11 @@ abbrev@1:
25982605
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
25992606
integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==
26002607

2608+
2609+
version "1.7.1"
2610+
resolved "https://registry.yarnpkg.com/abortcontroller-polyfill/-/abortcontroller-polyfill-1.7.1.tgz#27084bac87d78a7224c8ee78135d05df430c2d2f"
2611+
integrity sha512-yml9NiDEH4M4p0G4AcPkg8AAa4mF3nfYF28VQxaokpO67j9H7gWgmsVWJ/f1Rn+PzsnDYvzJzWIQzCqDKRvWlA==
2612+
26012613
accepts@~1.3.7:
26022614
version "1.3.7"
26032615
resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd"
@@ -8018,7 +8030,7 @@ log-update@^4.0.0:
80188030
slice-ansi "^4.0.0"
80198031
wrap-ansi "^6.2.0"
80208032

8021-
8033+
[email protected], loglevel@^1.7.1:
80228034
version "1.7.1"
80238035
resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.7.1.tgz#005fde2f5e6e47068f935ff28573e125ef72f197"
80248036
integrity sha512-Hesni4s5UkWkwCGJMQGAh71PaLUmKFM60dHvq0zi/vDhhrzuk+4GgNbTXJ12YYQJn6ZKBDNIjYcuQGKudvqrIw==
@@ -10344,7 +10356,7 @@ [email protected], [email protected]:
1034410356
dependencies:
1034510357
"@redux-saga/core" "^1.1.3"
1034610358

10347-
[email protected], redux@^4.0.4:
10359+
redux@4.1.0, redux@4.x, redux@^4.0.4:
1034810360
version "4.1.0"
1034910361
resolved "https://registry.yarnpkg.com/redux/-/redux-4.1.0.tgz#eb049679f2f523c379f1aff345c8612f294c88d4"
1035010362
integrity sha512-uI2dQN43zqLWCt6B/BMGRMY6db7TTY4qeHHfGeKb3EOhmOKjU3KdWvNLJyqaHRksv/ErdNH7cFZWg9jXtewy4g==

0 commit comments

Comments
 (0)