javascript-async-dom

JavaScript Async & DOM

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "javascript-async-dom" with this command: npx skills add sraloff/gravityboots/sraloff-gravityboots-javascript-async-dom

JavaScript Async & DOM

When to use this skill

  • Manipulating usage of fetch or XMLHttpRequest .

  • 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 check res.ok before parsing JSON. const res = await fetch('/api/data'); if (!res.ok) throw new Error('Failed'); const data = await res.json();

  • AbortController: Use AbortController to cancel pending requests when components unmount or fast interactions occur.

  1. 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 removeEventListener if listeners are attached to transient elements (or use { once: true } where applicable).

  1. DOM Manipulation
  • Performance: Minimize reflows. Read layout properties (offsetWidth, etc.) in a batch, then write styles in a batch.

  • Fragments: Use DocumentFragment when appending multiple elements to the DOM at once.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

caddy-modern-config

No summary provided by upstream source.

Repository SourceNeeds Review
General

apache-lamp-config

No summary provided by upstream source.

Repository SourceNeeds Review
General

server-management

No summary provided by upstream source.

Repository SourceNeeds Review