Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> The purpose of a promise is to allow an asynchronous operation to be cancelled.

It's not, and the javascript Promise/A spec has no such facility.

Promises — at least in javascript which is the language observed here — are used to return asynchronous results and be able to combine them in various manners (chain, multiplex, select), but not to cancel them.

The purpose of promises in javascript is very much to improve upon callbacks-based systems in order to make them easier to understand and reason about, and more composable.



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: