- From: James Bromwell <notifications@github.com>
- Date: Thu, 24 May 2018 06:31:24 -0700
- To: whatwg/xhr <xhr@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Thursday, 24 May 2018 13:31:46 UTC
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