Skip to main content

How do signals affect the approach to state management?

Signals (signals) in Angular are a new way to store and track state that makes state management simpler, more reactive, and more transparent.


How this changes the approach:

  1. You no longer need to subscribe manually
  • signals automatically track who is "watching" them
  • no need for subscribe(), unsubscribe(), or async
  1. State can be updated directly and declaratively
ts
const count = signal(0); count.set(count() + 1);
  1. The component updates itself when the signal changes
  • Angular tracks the dependencies itself
  • everything works faster and cleaner

What signals are good for:

  • local state (toggles, filters, UI flags)
  • state in services (signal() instead of BehaviorSubject)
  • linking components without RxJS

Example:

ts
@Injectable({ providedIn: 'root' }) export class AuthService { user = signal<User | null>(null); login(user: User) { this.user.set(user); } logout() { this.user.set(null); } }

Conclusion: Signals are a new, minimalist way to manage state, where everything is visible, everything is tracked automatically, and nothing leaks. This is especially useful when you don't need the whole RxJS or NgRx "orchestra".

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.