Files
policy-ui/app/composables/useCustomerProfileVault.ts
Jordan Weingarten 67482f6629 WIP jordan
2026-04-16 11:11:44 -05:00

19 lines
511 B
TypeScript

import { emptyCustomerProfile, type CustomerProfileVault } from '~/types/customer-profile'
import { useLocalStorageRef } from '~/utils/useLocalStorageRef'
const KEY = 'policy-ui-customer-profile-vault-v1'
export function useCustomerProfileVault() {
const profile = useLocalStorageRef(KEY, () => emptyCustomerProfile())
function touch() {
profile.value.updatedAt = new Date().toISOString()
}
function reset() {
profile.value = emptyCustomerProfile()
}
return { profile, touch, reset }
}