Skip to content
On this page

useLocalStorage

Category
Last Changed
a month ago

Reactive LocalStorage.

Usage

Please refer to useStorage

Type Declarations

export declare function useLocalStorage(
  key: string,
  initialValue: MaybeRef<string>,
  options?: StorageOptions<string>
): RemovableRef<string>
export declare function useLocalStorage(
  key: string,
  initialValue: MaybeRef<boolean>,
  options?: StorageOptions<boolean>
): RemovableRef<boolean>
export declare function useLocalStorage(
  key: string,
  initialValue: MaybeRef<number>,
  options?: StorageOptions<number>
): RemovableRef<number>
export declare function useLocalStorage<T>(
  key: string,
  initialValue: MaybeRef<T>,
  options?: StorageOptions<T>
): RemovableRef<T>
export declare function useLocalStorage<T = unknown>(
  key: string,
  initialValue: MaybeRef<null>,
  options?: StorageOptions<T>
): RemovableRef<T>
export declare function useLocalStorage(
  key: string,
  initialValue: MaybeRef<string>,
  options?: StorageOptions<string>
): RemovableRef<string>
export declare function useLocalStorage(
  key: string,
  initialValue: MaybeRef<boolean>,
  options?: StorageOptions<boolean>
): RemovableRef<boolean>
export declare function useLocalStorage(
  key: string,
  initialValue: MaybeRef<number>,
  options?: StorageOptions<number>
): RemovableRef<number>
export declare function useLocalStorage<T>(
  key: string,
  initialValue: MaybeRef<T>,
  options?: StorageOptions<T>
): RemovableRef<T>
export declare function useLocalStorage<T = unknown>(
  key: string,
  initialValue: MaybeRef<null>,
  options?: StorageOptions<T>
): RemovableRef<T>

Source

SourceDocs

Contributors

Anthony Fu
Antério Vieira
Shinigami
Pig Fang
Alex Kozack

Changelog

v6.9.2 on 11/19/2021
80409 - fix: interface typos (#938)
v6.3.3 on 9/12/2021
d6dd1 - feat(useStorage): support writing null value to storage, close #452
8a9c4 - feat(useStorage): support pass ref to useStorage
useLocalStorage has loaded