- From: Ben Kelly <notifications@github.com>
- Date: Mon, 16 Feb 2015 06:36:11 -0800
- To: slightlyoff/ServiceWorker <ServiceWorker@noreply.github.com>
Received on Monday, 16 February 2015 14:36:41 UTC
I think we discussed on IRC that the extendable promise approach doesn't work as a place to put things like `changePriority()` or `port.postMessage()`.
Some other ideas:
```
fetch('my/url.html', { withControl: true }).then(function (fetchControl) {
// fetchControl.abort()
// fetchControl.changePriority()
// fetchControl.post.postMessage()
return fetchControl.response();
}).then(function (response) {
// normal stuff
});
```
Or perhaps some kind of transforming function that takes a fetch returned Promise and gives you a Promise to the fetchControl.
```
withControl(fetch('my/url.html')).then(function (fetchControl) {
// fetchControl.abort()
// fetchControl.changePriority()
// fetchControl.post.postMessage()
return fetchControl.response();
}).then(function (response) {
// normal stuff
});
```
---
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/625#issuecomment-74516802
Received on Monday, 16 February 2015 14:36:41 UTC