Skip to main content

Utilities

The library exports a small set of utility functions and constants from @xocialive/ui-components/utils (or the default barrel).

Exports

ExportTypeDescription
PREFERENCE_KEYSConstantAll localStorage key names
DEFAULT_PREFERENCESConstantDefault values for each preference
loadPreferencesFromStorageFunctionReads preferences from localStorage as a typed object
savePreferencesToStorageFunctionWrites preferences to localStorage
type PreferenceKeyTypeUnion of all valid preference key strings

Import

import {
PREFERENCE_KEYS,
DEFAULT_PREFERENCES,
loadPreferencesFromStorage,
savePreferencesToStorage,
type PreferenceKey,
} from "@xocialive/ui-components/utils";

See also