Course lesson
Destroy an Angular Signal Effect Automatically or Manually
Angular provides a manualCleanup configuration option for effects, preventing automatic cleanup when the owner component/service is destroyed.
- Duration
- 2 min
- Access
- Free
- Transcript
- Retained from source evidence
Angular provides a manualCleanup configuration option for effects, preventing automatic cleanup when the owner component/service is destroyed.
With manualCleanup: true, you gain control but must manually call .destroy() on the EffectRef that is returned by your effect to release resources like intervals or subscriptions.
Remember, with great power comes great responsibility!