saschanaz at outlook.com (2017-05-08T06:06:23.712Z)
>So by default, promises must not be cancellable.
With some API change now the proposal allows this, similar to other token based proposals:
```js
// if you don’t want to allow other consumers cancel this call
// for security reasons or whatever, you can disallow it by
// creating chain explicitly:
function foo() {
const chain = new CancelableChain();
// here myFetch() will register to cancellation chain and will be canceled
// by chain.cancel()
return myFetch(“url”, { chain });
}
```
>So by default, promises must not be cancellable. With some API change now the proposal allows this, similar to other token based proposals: ``` // if you don’t want to allow other consumers cancel this call // for security reasons or whatever, you can disallow it by // creating chain explicitly: function foo() { const chain = new CancelableChain(); // here myFetch() will register to cancellation chain and will be canceled // by chain.cancel() return myFetch(“url”, { chain }); } ``` -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20170508/3250f0c2/attachment.html>