Re: [whatwg/fetch] Proposal: fetch with multiple AbortSignals (#905)

FYI: I added my experiments with abortable fetch on https://github.com/jovdb/fetch-hof
and in the end, I didn't need the **multiple** `AbortSignals` on fetch.

I have used the [CancelToken](https://github.com/zenparsing/es-cancel-token) proposal in my experiment.
I pass around this generic `CancelToken` from function to function, where each function can subscribe to the `CancelToken` and pass a new `CancelToken` to it children (if needed: like [withTimeout](https://github.com/jovdb/fetch-hof/blob/master/src/withTimeout.ts#L30-L31))

The `withFetchAbort` higher order function will create an `AbortController` and pass the `AbortSignal` to fetch, it also is [subscribed](https://github.com/jovdb/fetch-hof/blob/master/src/withFetchAbort.ts#L26_L31) to the `CancelToken`. If the `CancelToken` is cancelled, it will call `abortController.abort()` to cancel the fetch.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/905#issuecomment-496718114

Received on Tuesday, 28 May 2019 22:48:03 UTC