10 lines
371 B
TypeScript
10 lines
371 B
TypeScript
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<AppState> => {
|
|
return useState(
|
|
"some-unique-state-key-1",
|
|
() => new AppState(new Date()) // Initial value
|
|
);
|
|
};
|