nuxt-spring-boot-showcase/frontend/app/composables/application.ts
2025-11-19 20:22:22 -06:00

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
);
};