3 ms·
Cancellation is a high-level expression of intent that you no longer care about the result of the operation. Due to the very nature of asynchronous operations,
by int_19h 10y ago
Cancellation is a high-level expression of intent that you no longer care about the result of the operation.
Due to the very nature of asynchronous operations, it is, in general, impossible to even determine which layer will ultimately handle that request (e.g. in your example, whether the POST won't happen, or it'll be aborted, or it's already completed), much less how it'll be handled.
The assumption is that all layers will do their best effort (defined vaguely in a "common sense" way) to service that request.
That is a very useful abstraction to have, and I don't see why JS is special in that regard.