subscription-management
takeUntil pattern for Observable cleanup. Use when adding any Observable subscription to a component.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
takeUntil pattern for Observable cleanup. Use when adding any Observable subscription to a component.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Team quality gate as executable instruction. Use when reviewing completed work before merge, or when processing PR review comments received from other reviewers.
Generate well-formed user stories from technical context. Use when generating or improving story descriptions for an issue tracker.
Type-safe validated configuration properties from application.yml. Use when adding any externalisable value.
Consistent error handling with named exceptions and global handler. Use when implementing any method that can fail with a business reason.
Consistent, safe log statements with correct levels and no PII. Use when adding or reviewing log statements.
Team standard for improving existing code without changing behaviour. Use when refactoring code.
| name | subscription-management |
| description | takeUntil pattern for Observable cleanup. Use when adding any Observable subscription to a component. |
takeUntilprivate destroy$ = new Subject<void>();
ngOnInit(): void {
this.someObservable$.pipe(
takeUntil(this.destroy$)
).subscribe({ next: ..., error: ... });
}
ngOnDestroy(): void {
this.destroy$.next();
this.destroy$.complete();
}
OnDestroy.takeUntil(this.destroy$).destroy$ is always private and never exposed.this.destroy$.next() then this.destroy$.complete() — both, in that order..unsubscribe() manually — takeUntil handles it.Subscription objects and call .unsubscribe() in ngOnDestroyasync pipe as a substitute for takeUntil — they solve different problemstakeUntilDestroyed() from Angular CDK — this project uses the explicit Subject pattern