Skip to content

useStorageAsync ​

Category
Export Size
1.63 kB
Last Changed
2 months ago
Related

Reactive Storage in with async support.

Usage ​

Please refer to useStorage

Type Declarations ​

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

Source ​

Source • Docs

Contributors ​

Anthony Fu
Jelf
Doctorwu
丶远方
Wu Rui
ntnyq
Waldi
Andreas Weber

Changelog ​

v10.7.2 on 1/14/2024
c197e - fix: correct ssr handler (#3703)
v10.0.0-beta.5 on 4/13/2023
cb644 - refactor!: remove isFunction and isString utils
v10.0.0-beta.4 on 4/13/2023
4d757 - feat(types)!: rename MaybeComputedRef to MaybeRefOrGetter
0a72b - feat(toValue): rename resolveUnref to toValue
v9.13.0 on 2/18/2023
105f4 - fix: handle mergeDefaults option (#2773)
v8.9.3 on 7/14/2022
ab332 - fix!: rename type StorageAsyncOptions to UseStorageAsyncOptions (#1883)
499f6 - fix(useStorage)!: rename type StorageOptions to UseStorageOptions (#1867)

Released under the MIT License.