effect is running for every dependecy
ArielGueta opened this issue · comments
Ariel Gueta commented
import { signal, computed, effect, batch } from 'reactive-signal'
// Create a signal
const count = signal(0)
// Create a computed signal
const doubleCount = computed(() => count.value * 2)
// Create an effect
effect(() => {
console.log(`Count: ${count.value}, Double Count: ${doubleCount.value}`)
})
// Update the count signal
count.value = 1;
It logs twice:
"Count: 1, Double Count: 2"
当耐特 commented
Thank you very much. It has been fixed in version 1.0.2