Question · Svelte and SvelteKit course · Module 3: Reactivity and Runes

Cleanup in $effect

How do you perform cleanup in $effect?

Answer options

  • Using $effect.cleanup()
  • By returning a function from $effect
  • By calling destroy() at the end
  • Cleanup isn't possible

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