hi
- User
hi
- Assistant
Hello! How can I assist you today?
- User
is this ok? this is my custom reactive framework im building a dev tools widget with it import { Render, Root, Signal, Reader, IO, Box, Memo } from "../../lib/index"; import { Window } from "./Window"; import { Console } from "./Console"; import { Tools } from "./Tools";
interface Settings { mode: "console" | "tools"; }
const defaultSettings: Settings = { mode: "console" };
const loadSettings = Reader( (id: string) => ({ mode: localStorage.getItem(
${id}: mode) ?? "console", }) as Settings, );const saveSettings = IO((id: string, mode: Signal<"console" | "tools">) => { document.addEventListener("visibilitychange", () => localStorage.setItem(
${id}: mode, mode.ref()), ); });const initConsole = Reader((logs: any[]) => { console.log = (...things: any[]) => things.forEach((x) => logs.push(x)); });
const InitTools = (id: string): void => { const settings = loadSettings.ex(id).alt(defaultSettings); const mode = Signal(settings.mode); const logs: any[] = [];
initConsole.ex(logs); saveSettings.ex(id, mode);
Root(document.body, () => Render(() => { if (mode.ref() === "tools") initConsole.ex(logs); return Window({ id: id + "window", mode: mode, slot: () => mode.ref() === "console" ? Memo(() => Console({ logs }), id + "console", [ logs[logs.length - 1], ]) : Tools({}), }); }, [mode]), ); };
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.