Skip to content
On this page

useStorageAsync

Reactive Storage in with async support.

Usage

Please refer to useStorage

Type Declarations

Show Type Declarations
export interface UseStorageAsyncOptions<T>
  extends Omit<UseStorageOptions<T>, "serializer"> {
  /**
   * Custom data serialization
   */
  serializer?: SerializerAsync<T>
}
export declare function useStorageAsync(
  key: string,
  initialValue: MaybeComputedRef<string>,
  storage?: StorageLikeAsync,
  options?: UseStorageAsyncOptions<string>
): RemovableRef<string>
export declare function useStorageAsync(
  key: string,
  initialValue: MaybeComputedRef<boolean>,
  storage?: StorageLikeAsync,
  options?: UseStorageAsyncOptions<boolean>
): RemovableRef<boolean>
export declare function useStorageAsync(
  key: string,
  initialValue: MaybeComputedRef<number>,
  storage?: StorageLikeAsync,
  options?: UseStorageAsyncOptions<number>
): RemovableRef<number>
export declare function useStorageAsync<T>(
  key: string,
  initialValue: MaybeComputedRef<T>,
  storage?: StorageLikeAsync,
  options?: UseStorageAsyncOptions<T>
): RemovableRef<T>
export declare function useStorageAsync<T = unknown>(
  key: string,
  initialValue: MaybeComputedRef<null>,
  storage?: StorageLikeAsync,
  options?: UseStorageAsyncOptions<T>
): RemovableRef<T>
export interface UseStorageAsyncOptions<T>
  extends Omit<UseStorageOptions<T>, "serializer"> {
  /**
   * Custom data serialization
   */
  serializer?: SerializerAsync<T>
}
export declare function useStorageAsync(
  key: string,
  initialValue: MaybeComputedRef<string>,
  storage?: StorageLikeAsync,
  options?: UseStorageAsyncOptions<string>
): RemovableRef<string>
export declare function useStorageAsync(
  key: string,
  initialValue: MaybeComputedRef<boolean>,
  storage?: StorageLikeAsync,
  options?: UseStorageAsyncOptions<boolean>
): RemovableRef<boolean>
export declare function useStorageAsync(
  key: string,
  initialValue: MaybeComputedRef<number>,
  storage?: StorageLikeAsync,
  options?: UseStorageAsyncOptions<number>
): RemovableRef<number>
export declare function useStorageAsync<T>(
  key: string,
  initialValue: MaybeComputedRef<T>,
  storage?: StorageLikeAsync,
  options?: UseStorageAsyncOptions<T>
): RemovableRef<T>
export declare function useStorageAsync<T = unknown>(
  key: string,
  initialValue: MaybeComputedRef<null>,
  storage?: StorageLikeAsync,
  options?: UseStorageAsyncOptions<T>
): RemovableRef<T>

Source

Category
Last Changed
last month
Related

SourceDocs

Contributors

Anthony Fu
Jelf
ntnyq
Waldi
Andreas Weber

Changelog

No recent changes

Released under the MIT License.