javascript-async-dom
Provides patterns for efficient DOM interaction and async data fetching. Improves performance and maintainability of browser-based code.
Install
mkdir -p .claude/skills/javascript-async-dom && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/9869" && unzip -o skill.zip -d .claude/skills/javascript-async-dom && rm skill.zipInstalls to .claude/skills/javascript-async-dom
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Best practices for Fetch API, event delegation, and DOM manipulation.Key capabilities
- →Fetch API integration
- →Event delegation
- →DOM update batching
- →AbortController usage
How it works
It provides standardized patterns for async data fetching and high-performance DOM manipulation.
Inputs & outputs
When to use javascript-async-dom
- →Fetch API integration with abort support
- →High-performance event delegation for large lists
- →Batching DOM writes to minimize reflows
About this skill
JavaScript Async & DOM
When to use this skill
- Manipulating usage of
fetchorXMLHttpRequest. - Adding event listeners to DOM elements.
- Interacting with browser APIs (Local Storage, Navigator).
1. Async Data Fetching
- Fetch API: Use
fetch()with async/await. Always checkres.okbefore parsing JSON.const res = await fetch('/api/data'); if (!res.ok) throw new Error('Failed'); const data = await res.json(); - AbortController: Use
AbortControllerto cancel pending requests when components unmount or fast interactions occur.
2. event Delegation
- Listener Attachment: Attach listeners to a parent container rather than individual items for lists.
list.addEventListener('click', (e) => { if (e.target.matches('.item-btn')) { ... } }); - Cleanup: Always use
removeEventListenerif listeners are attached to transient elements (or use{ once: true }where applicable).
3. DOM Manipulation
- Performance: Minimize reflows. Read layout properties (offsetWidth, etc.) in a batch, then write styles in a batch.
- Fragments: Use
DocumentFragmentwhen appending multiple elements to the DOM at once.
When not to use it
- →Synchronous DOM manipulation
- →Non-async data fetching
Limitations
- →Requires understanding of async JS
How it compares
It focuses on performance and best practices for async JS rather than just functionality.
Compared to similar skills
javascript-async-dom side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| javascript-async-dom (this skill) | 0 | 6mo | No flags | Intermediate |
| web-games | 11 | 6mo | No flags | Intermediate |
| pwa-development | 9 | 4mo | Caution | Intermediate |
| vite | 7 | 5mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by sraloff
View all by sraloff →You might also like
web-games
davila7
Web browser game development principles. Framework selection, WebGPU, optimization, PWA.
pwa-development
alinaqi
Progressive Web Apps - service workers, caching strategies, offline, Workbox
vite
antfu
Vite build tool configuration, plugin API, SSR, and Vite 8 Rolldown migration. Use when working with Vite projects, vite.config.ts, Vite plugins, or building libraries/SSR apps with Vite.
webf-infinite-scrolling
openwebf
Create high-performance infinite scrolling lists with pull-to-refresh and load-more capabilities using WebFListView. Use when building feed-style UIs, product catalogs, chat messages, or any scrollable list that needs optimal performance with large datasets.
js-hoist-regexp
TheOrcDev
Hoist RegExp creation outside render or memoize with useMemo(). Apply when using regular expressions in React components or frequently called functions.
web-coder
mochan-tk
Use when: implementing frontend web apps with HTML, CSS, TypeScript, React, accessibility, responsive layout, or performance concerns.