Re: [fetch] Aborting a fetch (#27)

BTW, this would work pretty well with async/await:

```js
async function ajax(url){
  showSpinner();
  try{
    const r = await fetch(url);
    const json = await r.json();
    await displayData(json);
  }catch(e)
    showError(e);
  }finally{
    hideSpinner();
  }
}

var p = ajax('/test')
setTimeout(() => p.cancel(), 100);
```

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/27#issuecomment-93551499

Received on Wednesday, 15 April 2015 20:09:54 UTC