Sign in

Kevin Gibbons

@bakkot.com
68 followers 33 following 36 posts
PostsRepliesMedia
Kevin Gibbons @bakkot.com · 05/05/2025
Some of that is because the lack of syntax means we don't clean up things we probably should. For example, with a [hypothetical] disposable AbortController, it would be trivial to clean up outstanding fetch requests when other requests fail. Usually JS devs just don't bother.
using controller = new AbortController.AutoAbort();
let pages = await Promise.all(urls.map(url => fetch(url, { signal: controller.signal }));
// automatically cancels outstanding requests if any request fails
030