
Angular Destroyref
If you're still manually unsubscribing from observables in Angular or using the old ngOnDestroy pattern, this skill pushes you toward DestroyRef and takeUntilDestroyed, which became the recommended approach in Angular 16+. It covers the standard component cleanup pattern and also shows how to handle it in services, which is less obvious but equally important. The examples are minimal but hit the key scenarios. Honestly, this is one of those patterns that should just become muscle memory once you see it, and having Claude automatically reach for it when dealing with subscriptions saves you from memory leaks and outdated patterns.
- skills.sh installs
- 182
- GitHub stars
- 7
- last updated
- Aug 21, 2026
Install
$ npx -y skills add oguzhan18/angular-ecosystem-skills --skill angular-destroyref --agent claude-codeInstalls into .claude/skills of the current project.
Files
Angular DestroyRef
Version: Angular 16+ (2025) Tags: DestroyRef, Cleanup, takeUntilDestroyed
References: DestroyRef
Best Practices
- Use takeUntilDestroyed
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
@Component({})
export class MyComponent {
private destroyRef = inject(DestroyRef);
ngOnInit() {
this.data$.pipe(
takeUntilDestroyed(this.destroyRef)
).subscribe();
}
}
- Use in service
@Injectable({ providedIn: 'root' })
export class DataService {
private destroyRef = inject(DestroyRef);
getData() {
return this.http.get('/api/data').pipe(
takeUntilDestroyed(this.destroyRef)
);
}
}
Sponsors
Details
- Repository
- github.com/oguzhan18/angular-ecosystem-skills
- Category
- Frontend Development
- First seen
- Jun 3, 2026
More from oguzhan18/angular-ecosystem-skills
All 45- Angular Forms182
- Angular Pipes180
- Angular Resolvers179
- Angular Deferrable178
- Angular Resource178
- Angular Signals178
- Angular Signals Forms178
- Angular Reactive177
- Angular Directives176
- Angular Lifecycle176
- Angular Di175
- Angular Viewchild174
- Angular Cypress172
- Angular Router172
- Angular Control Flow170
- Angular Zoneless170
- Nx170
- Angular Signals Http169
- Angular Ssr168
- Angular Injector165
- Angular Query160
- Shadcn Ng152
- Angular Tailwind245
- Angular Material233