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

Isn't this issue handled by promises and other work on making JS itself more "asyncish"? In other words, I would consider an implementation somewhat obnoxious if it warned me against doing something like 

    new Promise(function(resolve, reject){
        var foo = new XMLHttpRequest();
        foo.open('GET', 'bar.txt', false);
        foo.onload = function(){resolve(foo.responseText)}
        foo.onerror = function(){reject(foo}
        foo.send();
    }).then( /* do the work that required waiting for the response */ );

FWIW, I think I'd vote for allowing synchronous APIs in the web platform and solving the problem with browsers being so single-threaded by focusing on *that* problem.

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/xhr/issues/20#issuecomment-172825336

Received on Tuesday, 19 January 2016 11:40:19 UTC