News for hackers. Stuff that matters.
Re:Show HN: Cancelable async primitives for JavaScript by Rapzid on Tuesday August 08, 2017 @08:19PM (#14964345)
There is a cancellation library kicking around npm that reasonably mimics C#'s.

There must have been man-years of discussion on the Bluebird project around cancellation, but for me it all comes back to tokens as every promise baked-in solution feels a bit off. Golang effectively has them as well via the context package.

*As you say it is pretty easy to do, but it's nice to standardize on an implementation

Re:Show HN: Cancelable async primitives for JavaScript by inglor on Wednesday August 09, 2017 @08:05AM (#14967716)
Yes, we've been reading all the golang discussion very carefully. It's nice to see them go through the same mental process we went through - and my hopes are that if we don't interfere they'll come up with a better idea we can just copy.

We've had 4 cancellation proposals rejected so far (cancellation as rejection, third state, cancellable-promise and cancel-tokens).

They work in bluebird pretty well - but people have concerns.

Personally I use our cancellation if I already have bluebird, and tokens if I don't.