Put in order · Angular course · Module 6: Signals

Effect lifecycle

Arrange the stages of an effect that cleans up a resource (e.g. setInterval).

Items to put in order

  • A change to the signal triggers the effect to run again
  • onCleanup clears the previous resource (clearInterval)
  • The effect runs a side-effect (e.g. setInterval)
  • The effect reads a signal and registers it as a dependency

You can check the correct answer by solving this task in the CodeWorlds game.