angular-destroyref
CommunityPrevent memory leaks with DestroyRef
System Documentation
## What problem does it solve? Angular components and services often leak subscriptions and resources when cleanup is handled manually with Subjects or ngOnDestroy, leading to memory leaks and unpredictable behavior. This Skill provides clear patterns and examples to adopt DestroyRef and takeUntilDestroyed for deterministic teardown and safer lifecycle management.
## Core Features & Use Cases
- Deterministic Teardown: Shows how to use takeUntilDestroyed with injected DestroyRef to automatically unsubscribe observables in components and services.
- Migration Guidance: Describes replacing manual Subject-based cleanup or ngOnDestroy logic with DestroyRef-based patterns.
- Practical Examples: Includes component and service snippets that demonstrate injection of DestroyRef and integration with RxJS pipelines, useful for refactoring and code reviews.
### Quick Start Ask the skill to analyze a component and suggest a migration that replaces manual ngOnDestroy/Subject teardown with DestroyRef and takeUntilDestroyed.
Dependency Matrix
Required Modules
None requiredComponents
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: angular-destroyref Download link: https://github.com/oguzhan18/angular-ecosystem-skills/archive/main.zip#angular-destroyref Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.