Finally can run the UI

This commit is contained in:
Yura Dupyn 2026-02-18 01:20:16 +01:00
parent 115b457173
commit 49ef33f113
3 changed files with 95 additions and 159 deletions

View file

@ -10,6 +10,7 @@ import { updateDigith } from "src/ui/Scrowl/scrowlStore";
import { DigithError } from "src/ui/Digith/DigithError";
import { Value } from "src/lang/eval/value";
import { Val } from "src/ui/Component/Value";
import { externalSubscribe } from "src/lang/eval/signalValue";
type Input = {
raw_body: string,
@ -50,9 +51,9 @@ export function SignalDigith(props: { signal: Digith.Signal }) {
const signal = Program.get_or_create_signal(program, props.signal.name);
// TODO: Not sure about this one. Setting a signal in `setValue` is discouraged.
setTimeout(() => setValue(signal.read()), 0);
setTimeout(() => setValue(signal.currentValue), 0);
const cancel = signal.subscribe((newValue) => {
const cancel = externalSubscribe(signal, (newValue) => {
setValue(newValue);
});
onCleanup(cancel);