useStorageAsync
具有异步支持的响应式 Storage。
用法
请参考 useStorage
类型声明
显示类型声明
typescript
export interface UseStorageAsyncOptions<T>
extends Omit<UseStorageOptions<T>, "serializer"> {
/**
* 自定义数据序列化
*/
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
贡献者
Anthony Fu
丶远方
Jelf
Anthony Fu
Doctorwu
Wu Rui
ntnyq
Waldi
Andreas Weber
变更日志
v10.7.2
on 1/14/2024v10.0.0-beta.5
on 4/13/2023cb644
- refactor!: remove isFunction
and isString
utilsv10.0.0-beta.4
on 4/13/20234d757
- feat(types)!: rename MaybeComputedRef
to MaybeRefOrGetter
0a72b
- feat(toValue): rename resolveUnref
to toValue
v9.13.0
on 2/18/2023