- From: Yutaka Hirano <notifications@github.com>
- Date: Tue, 30 Oct 2018 20:25:00 -0700
- To: whatwg/fetch <fetch@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Wednesday, 31 October 2018 03:25:21 UTC
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