-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Description
Describe the bug
using createDeferred within node, while using node -C browser file.js, causes the process thread to hang and never exit.
Add this to a file:
import { createSignal, createEffect, createRoot, createDeferred } from "solid-js";
function createCounter(initial = 0) {
const [count, setCount] = createSignal(initial);
const def = createDeferred(() => (count() * 2), { timeoutMs: 2000 })
createEffect(() => {
console.log(`Count changed, new value: ${count()}`);
});
function increment() {
setCount((c) => c + 1);
}
function reset() {
setCount(initial);
}
return { count, increment, reset, def };
}
createRoot((dispose) => {
const { count, increment, reset, def } = createCounter(10);
console.log(count())
console.log(def())
increment();
console.log(count())
console.log(def())
reset();
console.log(count())
console.log(def())
dispose();
});Run it with node -C browser ./file.js, it will print out correctly but the process will not end properly.
Platform
OS: macOS
Browser: nodejs
Version: ^1.9.10
Metadata
Metadata
Assignees
Labels
No labels