MCPcopy
hub / github.com/vueuse/vueuse / useLocalStorage

Function useLocalStorage

packages/core/useLocalStorage/index.ts:21–28  ·  view source on GitHub ↗
(
  key: MaybeRefOrGetter<string>,
  initialValue: MaybeRefOrGetter<T>,
  options: UseStorageOptions<T> = {},
)

Source from the content-addressed store, hash-verified

19 * @param options
20 */
21export function useLocalStorage<T extends(string | number | boolean | object | null)>(
22 key: MaybeRefOrGetter<string>,
23 initialValue: MaybeRefOrGetter<T>,
24 options: UseStorageOptions<T> = {},
25): RemovableRef<any> {
26 const { window = defaultWindow } = options
27 return useStorage(key, initialValue, window?.localStorage, options)
28}

Callers

nothing calls this directly

Calls 1

useStorageFunction · 0.90

Tested by

no test coverage detected