JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://rawgit.com/WebReflection/0ca8fac8013f76fb4d06/raw/1bdfb5f472f59dfc3ce2855fdd0592265178c26e/Promise-rejet.js"></script>
JavaScript
// sync cancellation - does what I expect
var d = new Promise(function(resolve, reject, c){
c(alert.bind(null, "Cancellation"));
setTimeout(resolve);
});
d.then(function(e){
return Promise.resolve();
}).catch(function(res){
alert("Caught");
});
d.cancel();