Closed
Description
Describe the bug
If you add an $inspect
that is listening on a variable that is also listening on an $effect
the $effect
is run syncronously instead of the next microtask.
<script>
let count = $state(0);
function increment() {
count += 1;
console.log("in-increment", count);
}
$effect(() => {
console.log("effect", count);
});
$inspect(count);
</script>
<button onclick={increment}>
clicks: {count}
</button>
on click it will log
effect 1
update 1
in-increment 1
Reproduction
Logs
No response
System Info
repl
Severity
annoyance
Metadata
Metadata
Assignees
Labels
No labels