Skip to content
On this page

useLocalStorage

Category
Export Size
2.19 kB
Last Changed
5 months ago
Related

Reactive LocalStorage.

Usage

Please refer to useStorage

Type Declarations

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

Source

SourceDocs

Contributors

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

Changelog

v8.9.3 on 7/14/2022
499f6 - fix(useStorage)!: rename type StorageOptions to UseStorageOptions (#1867)
v8.9.1 on 7/8/2022
a9ccc - feat(all): use MaybeComputedRef (#1768)
v6.9.2 on 11/19/2021
80409 - fix: interface typos (#938)

Released under the MIT License.