- From: José Moreira <notifications@github.com>
- Date: Thu, 30 Mar 2017 02:17:19 -0700
- To: whatwg/fetch <fetch@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Thursday, 30 March 2017 09:17:50 UTC
> The native `fetch()` API implemented by browsers does not use XMLHttpRequest underneath. But yet, it does not mean it couldn't be pondered and proposed. Native promises are not yet cancellable and/or progressed, so my proposal would be for a callback on the second argument object of `fetch` which would receive a `ProgressEvent` (which is already present because of XHR). As a polyfill, it could be easily placed with the `progress` event listener as stated by the OP. API Example: ```js aync fetchSometing ( form ) { const res = await fetch('/upload', { method: 'POST', body: form, progress: (e) => { console.log(`Progress: ${e.loaded/e.total}%`) } }) } ``` -- 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/21#issuecomment-290351717
Received on Thursday, 30 March 2017 09:17:50 UTC