Experiment to rebuild Diffuse using web applets.
1import { signal } from "spellcaster";
2
3import type { Method } from "./types";
4import { DEFAULT_METHOD, LOCALSTORAGE_KEY, METHODS } from "./constants";
5
6export const stored = localStorage.getItem(LOCALSTORAGE_KEY);
7export const [active, setActive] = signal<Method>(
8 stored && METHODS.includes(stored as Method) ? (stored as Method) : DEFAULT_METHOD,
9);