— Just makes a new one and rejects it, haha
— That's just a static method
— It doesn't exist on promise objects, only the constructor
— The problem is getting the abort to the underlying native code
— Well, in a shim you could attach cancel to a xhr.abort
— Whatever mechanism timeout uses
—
const xhr = (url) => {
const x = new XMLHttpRequest();
const p = new Promise(...);
p.cancel = () => x.abort();
return p;
};
Message permanent page