JSFiddle - React, Tailwind, and code Playground
by tonytlwu
JavaScript
var prom = new Promise(function (resolve) {
setTimeout(resolve, 2000);
});
prom.then(function () {
console.log('promise resolved')
})
// Setting the promise to null doesn't cancel or stop the promise
prom = null