Message from JavaScript discussions

May 2017

— Whatever mechanism timeout uses

— 

const xhr = (url) => {
const x = new XMLHttpRequest();
const p = new Promise(...);
p.cancel = () => x.abort();
return p;
};

— Well, internal map

— That work

— Works*

— Promise.cancel(myPromise);

— Seems very implementation specific imo

— Well, surface api is the same anyway

— Maybe there can be an "onCancel" handler like the other two handlers in the promise

— This map would have to contain all active promises though

— Ohh boy

— That would be a memory concern I think