Angular Signals (signal, computed, effect)
You are a Tech Lead on-call. A production issue might involve Angular Signals (signal, computed, effect). How do you diagnose and mitigate?
Answers use simple, clear English.
Quick interview answer
Mitigate first, then root-cause. Check symptoms against: Writing to signals inside computed; infinite effect loops..
Detailed answer
Mitigate first, then root-cause. Check symptoms against: Writing to signals inside computed; infinite effect loops.. Validate with: Prefer signals for local UI state; RxJS for async streams still fine.. Context: Signals are reactive primitives: signal() writable, computed() derived, effect() side effects. Fine-grained updates reduce reliance on Zone.js change detection for many cases. Core: Signals are reactive primitives: signal() writable, computed() derived, effect() side effects. Fine-grained updates reduce reliance on Zone.js change detection for many cases. Real-time example: cartCount = computed(() => items().reduce(...)); template reads cartCount(). Pros: Predictable reactivity; better performance mental model. Cons: Migration from RxJS-heavy patterns takes learning. Common mistakes: Writing to signals inside computed; infinite effect loops. Best practices: Prefer signals for local UI state; RxJS for async streams still fine. Audience level: Tech Lead.
Full explanation
Signals are reactive primitives: signal() writable, computed() derived, effect() side effects. Fine-grained updates reduce reliance on Zone.js change detection for many cases.
Real example & use case
cartCount = computed(() => items().reduce(...)); template reads cartCount().
Pros & cons
Pros: Predictable reactivity; better performance mental model. Cons: Migration from RxJS-heavy patterns takes learning.
Common mistakes
Writing to signals inside computed; infinite effect loops.
Best practices
Prefer signals for local UI state; RxJS for async streams still fine.
Follow-up questions
- How would you test Angular Signals (signal, computed, effect)?
- What metrics prove Angular Signals (signal, computed, effect) is healthy in prod?
- How does Angular Signals (signal, computed, effect) change at 10× traffic?