useStorageAsync
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: 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
Contributors
Anthony Fu
Jelf
Wu Rui
ntnyq
Waldi
Andreas Weber