You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I started this topic out as a discussion (#14717), and by playing a bit more, I think the coloring is meant to show which signal or signals triggered the reactive block. If this is the case, then:
The documentation has no mention of this.
The functionality seems to be buggy (see repro).
Colorblind people will have an issue with this, as they might not be able to perceive the color change.
Furthermore, the documentation seems inaccurate. It reads:
information will be printed to the console about which pieces of reactive state caused the effect to fire.
This doesn't seem to be the case only. It seems that it also shows the signals that were recorded last for the effect, whether they contributed to the firing or not. When I read the documentation, I imagined the output was going to be exclusively comprised of the signals that changed its value.
<script>
let count =$state(0);let now =$state(false);$effect(() => {$inspect.trace('My Effect');if (count >=5|| now) {alert('Stop the madness.'); } });
</script>
<buttontype="button"onclick={() =>++count}>
Click me
</button>
<inputtype="checkbox"bind:checked={now} />
The image shows the console output after clicking the button once. The first output (marked 1) looks OK: The count and now signals were read, and the entries are blue because it is the effect's first run.
However, once the button is clicked, only one of the signals change its value, as clearly seen in the console output, yet both are colored blue (marked 2).
Further clicking the button will produce console output that seems to be consistent: Only the numerical state is marked blue.
Logs
No response
System Info
REPL
Severity
annoyance
The text was updated successfully, but these errors were encountered:
Describe the bug
Hello! I started this topic out as a discussion (#14717), and by playing a bit more, I think the coloring is meant to show which signal or signals triggered the reactive block. If this is the case, then:
Furthermore, the documentation seems inaccurate. It reads:
This doesn't seem to be the case only. It seems that it also shows the signals that were recorded last for the effect, whether they contributed to the firing or not. When I read the documentation, I imagined the output was going to be exclusively comprised of the signals that changed its value.
Reproduction
REPL
The image shows the console output after clicking the button once. The first output (marked 1) looks OK: The
count
andnow
signals were read, and the entries are blue because it is the effect's first run.However, once the button is clicked, only one of the signals change its value, as clearly seen in the console output, yet both are colored blue (marked 2).
Further clicking the button will produce console output that seems to be consistent: Only the numerical state is marked blue.
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: