import { AppState } from "~/ui"; // Important: this exposes a global (per web app) state of type `AppState`. // As with any other `Ref` variable, when the state changes, dependent views are automatically updated. export const appState = (): Ref => { return useState( "some-unique-state-key-1", () => new AppState(new Date()) // Initial value ); };