chad/client/app/composables/use-global-state.ts
Никита Круглицкий fb5b42e9db
All checks were successful
Deploy / deploy (push) Successful in 1m38s
front update
2025-10-05 21:43:28 +06:00

19 lines
376 B
TypeScript

import type { Client } from '#shared/types'
import { createGlobalState, useLocalStorage } from '@vueuse/core'
export const useGlobalState = createGlobalState(() => {
const username = useLocalStorage<string>('username', '')
const clients = shallowRef<Client[]>([])
function reset() {
clients.value = []
}
return {
username,
clients,
reset,
}
})