[whatwg/fetch] Odd format for fetch callbacks (#536)

https://fetch.spec.whatwg.org/#fetch-method has:
> 5. Run the following in parallel:
>    * Fetch *request*.
>    * To [process response](https://fetch.spec.whatwg.org/#process-response) for *response*, run these substeps: ...
>    * To [process response done](https://fetch.spec.whatwg.org/#process-response-done) for *response*, run these substeps: ...

"process response" and "process response done" are defined as "Tasks that are queued by this standard are annotated as one of: ...", but they actually appear to be customization points within the Fetch algorithm for which the caller can provide an implementation. Assuming that's right, then:

1. It doesn't make sense to say to run the fetch and its callbacks in parallel. Instead, we should run the fetch in parallel with the callbacks passed in.
2. The callbacks need their defaults defined for when callers don't pass them in. I think the defaults are to be no-ops?
3. The callbacks should be defined as customization points, not just annotations.

-- 
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/536

Received on Tuesday, 2 May 2017 22:26:57 UTC