Duolith docs

Warnings while reading a page

W0022 Effect that sets off itself

Message this effect reads name and assigns it, so each run makes it run again

Words in italics are filled in when the compiler reports it, such as the element's name or the list of known ones.

Why

An effect runs again whenever state it read changes. One that assigns the same state makes itself run again, which at best repeats work and at worst loops until the runtime stops it. Reads inside untracked(() => ...) are not followed.

How to fix it

Compute the value with derived(...) instead, or read the state inside untracked(() => ...) if the effect should not follow it.

In a terminal

duolith explain W0022

Mentioned in