Re: [whatwg/fetch] Consider to add "resolveAtIdleTime" to RequestInit (#821)

Just having a general function, say waitForIdle, looks simpler to me. We can use it with timeout fairly easily.

```
function wait(ms) { return new Promise(res => setTimeout(res, ms)); }
const timeout = wait(100);
const resp = await fetch(...);
await Promise.race([waitForIdle(), timeout]);
```

This actually executes tiny code when it's not idle, but I think we can bear with it.


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/821#issuecomment-434548200

Received on Wednesday, 31 October 2018 03:25:21 UTC