Skip to content

useLocalStorage ​

Category
Export Size
2.02 kB
Last Changed
last year
Related

Reactive LocalStorage.

Usage ​

Please refer to useStorage

Type Declarations ​

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

Source ​

Source • Docs

Contributors ​

Anthony Fu
Antério Vieira
ntnyq
Jelf
Shinigami
Pig Fang
Alex Kozack

Changelog ​

v10.0.0-beta.4 on 4/13/2023
4d757 - feat(types)!: rename MaybeComputedRef to MaybeRefOrGetter
v8.9.3 on 7/14/2022
499f6 - fix(useStorage)!: rename type StorageOptions to UseStorageOptions (#1867)

Released under the MIT License.