I replied on Hacker News with my feelings (as a TC39 member) about what's happening with promise cancellation: https://news.ycombinator.com/item?id=13214487 …
-
-
interesting thing about cancellation is that there's already a place to hook the implicit token param most of the time (await)
-
you just need new syntax to kick off the chain, and you can have `task` produce a tuple of (Promise, CT) w/o leaking everywhere
-
you can also allow funcs to override propagating w/ somethg like await.cancel = null (or a different CT) also w/o worse defaults
-
I like. If you bottom out on a hand-rolled promise, it can presumably just capture await.cancel and wire up a callback on the token.
-
yes, exactly.
-
it could be passed into the promise constructor potentially for the last mile. Tricky to cross the lang/lib divide.
-
I think some people don't like await.cancel being available in all functions (I don't mind).
-
also need to make sure it's possible to convey to combinators like Promise.all. Perhaps enough to immediate invoke async func
- 1 more reply
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.