JSFiddle - React, Tailwind, and code Playground
JavaScript
class Container {
stop(cb) {
cb();
console.log("Container stopped");
}
remove() {
return new Promise((resolve, reject) => {
reject();
console.log("Remove rejected");
});
}
kill() {
console.log('Container killed');
}
}
const container = new Container();
container.stop(() => container.remove().catch(container.kill));