Re: [ServiceWorker] Returning a FetchPromise from fetch() (#625)

I am not sure if you disccused this before, but here is another thing which might work:
```javascript
var req = fetch('...', function(abort) {
  onESCPressed(abort);
});

req.then(function() { ... }).catch(function(err) {
  // err -> FetchError, type: 'cancelation'
});
```

Something like that. I looks like ```Promise``` executor (```function(resolve, reject) {}```), but only provides ```abort``` capability (or maybe all others too?) and ```abort``` action is just a wrapper for ```reject``` action. Hence ```FetchPromise``` just rejects with ```cancelation``` reason.

---
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/625#issuecomment-76628335

Received on Sunday, 1 March 2015 20:24:15 UTC