UNPKG

@wener/console

Version:

Base console UI toolkit

18 lines (17 loc) 467 B
import { useLocalStorageState } from "../../web/hooks/index.js"; export function useUserPreferenceState({ key, schema }) { const [value, set] = useLocalStorageState(`UserPerf.${key}`, { defaultValue: () => { try { return schema?.parse({}) || {}; } catch (e) { } return {}; } }); return [ value, set ]; } //# sourceMappingURL=useUserPreferenceState.js.map