>
>
> That design seems far cleaner than adding functionality directly to
> promises, but can it be made JS-ergonomic?
>
>
The question we need to consider when it comes to a general design for
canceling async tasks is this: how does one offer cancellation when
defining an async task using an async function?
async function af() {
// A bunch of awaits in here.
// How can I allow the initiator to cancel?
}
Adding a "cancel" method to (some) promises doesn't work for async
functions, but something like the cancellation token approach would.
So again the question is: can we come up with a cancellation-token-style
pattern which is JS-ergonomic?
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss