Subscription management

From andresdiegolanda/design-first-ai · View interactive version

Subscription management is an AI agent skill from the GitHub repository andresdiegolanda/design-first-ai. takeUntil pattern for Observable cleanup. Use when adding any Observable subscription to a component.

How to use this skill

Skill file

Skill: Subscription Management (angular-user-search)

The pattern — always `takeUntil`

private destroy$ = new Subject<void>();

ngOnInit(): void {
  this.someObservable$.pipe(
    takeUntil(this.destroy$)
  ).subscribe({ next: ..., error: ... });
}

ngOnDestroy(): void {
  this.destroy$.next();
  this.destroy$.complete();
}

Rules

Design Constraints

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.