It seems like I may not have accurately conveyed my issue, but here it is:
When the render signal is triggered, an object creation process occurs that generates additional effects dependent on the update signal. However, the scope appears to be disposed and these effects only fire once at creation time. Despite having references to these objects, how can I ensure that the nested createEffect continues to trigger?
import { render } from 'solid-js/web';
import { on, createSignal, createEffect } from 'solid-js'
function HelloWorld() {
let [render, setRender] = createSignal(undefined, { equals: false })
let [update, setUpdate] = createSignal(undefined, { equals: false })
let i = 0
createEffect(on(render, () => {
if (i++ === 1) {
createEffect(on(update, () => {
console.log('inside')
}))
}
}))
createEffect(on(update, () => {
console.log('regular', i)
}))
setInterval(() => {
setUpdate();
setRender();
})
return <div>Hello World!</div>;
}
render(() => <HelloWorld />, document.getElementById('app'))
I am aiming to see both regular
and inside
logs triggered consistently at each interval.