How to Cancel Your Promise
In ES2015, new version of EcmaScript, standard of JavaScript, we got new asynchronous primitive Promise. It is a very powerful concept, which allows us to avoid notoriously famous callback hell.
But, as soon it was discovered, you can not cancel a promise, and this is a real problem. Sometimes you have to cancel something, and you need to build a workaround – the amount of work depends how often do you need this functionality.
Hope the code snippets helps !!!