Svelte · Senior · Question 18 of 75

What does $state.eager do in async Svelte?

<a href="/about" aria-current={$state.eager(pathname) === "/about" ? "page" : null}>About</a>

Explanation

Use it sparingly, only for feedback to user actions; normally letting Svelte coordinate updates gives a better result.

Further reading

Problem with a question

Svelte · Senior · question 18

Test yourself

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

Take this quiz