Re: [whatwg/xhr] Abandon hope of removing sync XHR from the web platform? (#20)

None of this is hard with promises (as returned by `fetch`):

````js
function factorial(n) {
  if (n <= 1) { return Promise.resolve(1); }
  return factorial(n-1).then(result => mult(n, result));
}

// Pretend this is an fetch to a REST service that multiplies numbers for some reason
function mult(x, y) { return new Promise(resolve => setTimeout(() => resolve(x * y), 1000)); }
````

-- 
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/xhr/issues/20#issuecomment-391715532

Received on Thursday, 24 May 2018 13:31:46 UTC