Performance: AbortController for cancellation
MEDIUM IMPACT
This affects how efficiently asynchronous operations can be stopped to save resources and improve responsiveness.
const controller = new AbortController(); const signal = controller.signal; const response = await fetch(url, { signal }); // Later if needed controller.abort();
const response = await fetch(url); // No cancellation, fetch runs to completion even if no longer needed
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| No cancellation | N/A | N/A | N/A | [!] Poor |
| Using AbortController | N/A | N/A | N/A | [OK] Good |