-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Description
Describe the bug
I can't get createEffect to execute at all within a test/nodejs process...
I copied the documentation verbatim, Basic Usage code sample:
https://docs.solidjs.com/reference/reactive-utilities/create-root#basic-usage
and then ran it with node ./file.js, does not trigger an effect.
Is it a bug?
Your Example Website or App
just execute the sample code
Steps to Reproduce the Bug or Issue
copy this into a file:
import { createSignal, createEffect, createRoot } from "solid-js";
import { render } from "solid-js/web"
function createCounter(initial = 0) {
const [count, setCount] = createSignal(initial);
createEffect(() => {
console.log(`Count changed, new value: ${count()}`);
});
function increment() {
setCount((c) => c + 1);
}
function reset() {
setCount(initial);
}
return { count, increment, reset };
}
createRoot((dispose) => {
const { count, increment, reset } = createCounter(10);
console.log(count())
increment();
console.log(count())
reset();
console.log(count())
dispose();
});and run the file with node ./file.js
Expected behavior
should print to console Count changed ... message, it does not print
Screenshots or Videos
No response
Platform
- OS: macOS
- Browser: nodejs
- Version: ^1.9.10
Additional context
No response
Metadata
Metadata
Assignees
Labels
No labels