Open rschristian opened 3 weeks ago
Not quite sure of the cause & don't have time to chase it down yet, but the tracking of dependencies in effect and useSignalEffect seems to be a bit broken in the context of our REPL. For example, here's a lazy effect:
effect
useSignalEffect
import { signal, effect, useSignalEffect } from '@preact/signals'; const count = signal(0); const initialized = signal(false); effect(() => { count.value; if (!initialized.peek()) return initialized.value = true; console.log(count.value) }); count.value++;
The effect here will not subscribe to count, even though it's explicitly accessed. Swapping that to count.value.toString() works, however.
count
count.value.toString()
Not quite sure of the cause & don't have time to chase it down yet, but the tracking of dependencies in
effect
anduseSignalEffect
seems to be a bit broken in the context of our REPL. For example, here's a lazy effect:The effect here will not subscribe to
count
, even though it's explicitly accessed. Swapping that tocount.value.toString()
works, however.