Defer or lazy-load heavy work so it only happens when actually needed
Scanned 9/3/2026
Install to Claude Code
npx -y skills add black141312/ada --skill lazy-load --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Lazy Load?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/black141312-lazy-load)More formats (shields.io, HTML) on the badges page.
---
name: lazy-load
description: Defer or lazy-load heavy work so it only happens when actually needed
category: performance
---
# Lazy Load
Reach for this when startup, page load, or a request pays for work whose result is often unused.
1. Identify eager work that's expensive and not always needed: big imports, asset bundles, DB connections, precomputed data, or off-screen UI.
2. Move the work behind first use — lazy imports/`import()`, deferred initialization, computed-on-demand, or route/component code-splitting.
3. For UI/data, load on interaction or visibility (intersection observer, pagination, infinite scroll) instead of all up front.
4. Memoize the deferred result so the expensive work runs at most once, not on every access.
5. Add a lightweight placeholder/loading state and guard against repeated concurrent initialization (race on first use).
6. Measure the win — faster startup/first paint or smaller initial payload — and confirm deferred paths still work.
## Rules
- Lazy-loading trades first-use latency for faster startup; don't defer work that's needed immediately on the critical path.
- Always cache the result of a lazy init so you don't recompute on every call.
- Guard the first-use path against concurrent callers triggering the heavy work twice.
- Don't over-split — too many tiny lazy chunks add round-trips and can be slower than one bundle.
- Keep a visible loading/fallback state so deferred work doesn't look like a hang.
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!