Svelte · Middle · Question 3 of 75

Which state does $effect track as dependencies?

$effect(() => {
  console.log(color);
  setTimeout(() => console.log(size), 0);
});

Explanation

Values read after await or in callbacks aren't tracked. Dependencies are also re-collected on each run, so conditional reads matter.

Further reading

Problem with a question

Svelte · Middle · question 3

Test yourself

Take the Svelte · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz