Skip to content
On this page

useSessionStorage

Category
Last Changed
2 months ago

Reactive SessionStorage.

Usage

Please refer to useStorage

Type Declarations

export declare function useSessionStorage(
  key: string,
  initialValue: MaybeRef<string>,
  options?: StorageOptions<string>
): RemovableRef<string>
export declare function useSessionStorage(
  key: string,
  initialValue: MaybeRef<boolean>,
  options?: StorageOptions<boolean>
): RemovableRef<boolean>
export declare function useSessionStorage(
  key: string,
  initialValue: MaybeRef<number>,
  options?: StorageOptions<number>
): RemovableRef<number>
export declare function useSessionStorage<T>(
  key: string,
  initialValue: MaybeRef<T>,
  options?: StorageOptions<T>
): RemovableRef<T>
export declare function useSessionStorage<T = unknown>(
  key: string,
  initialValue: MaybeRef<null>,
  options?: StorageOptions<T>
): RemovableRef<T>
export declare function useSessionStorage(
  key: string,
  initialValue: MaybeRef<string>,
  options?: StorageOptions<string>
): RemovableRef<string>
export declare function useSessionStorage(
  key: string,
  initialValue: MaybeRef<boolean>,
  options?: StorageOptions<boolean>
): RemovableRef<boolean>
export declare function useSessionStorage(
  key: string,
  initialValue: MaybeRef<number>,
  options?: StorageOptions<number>
): RemovableRef<number>
export declare function useSessionStorage<T>(
  key: string,
  initialValue: MaybeRef<T>,
  options?: StorageOptions<T>
): RemovableRef<T>
export declare function useSessionStorage<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
useSessionStorage has loaded