- From: Jake Archibald <notifications@github.com>
- Date: Fri, 29 Jan 2016 16:57:59 -0800
- To: whatwg/fetch <fetch@noreply.github.com>
Received on Saturday, 30 January 2016 00:58:32 UTC
@riking I don't fully understand the aim of your code. I'd handle long-polling like this:
```js
function poll(url, handleResult) {
return fetch(url)
.then(handleResult)
.then(poll, () => wait(1000).then(poll));
}
var poll = poll(url, cb);
// later...
poll.cancel();
```
---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/27#issuecomment-177035206
Received on Saturday, 30 January 2016 00:58:32 UTC