useStorageAsync
Reactive Storage in with async support.
Please refer to useStorage
Type Declarations
Show Type Declarations
export interface StorageAsyncOptions<T>
extends Omit<StorageOptions<T>, "serializer"> {
/**
* Custom data serialization
*/
serializer?: SerializerAsync<T>
}
export declare function useStorageAsync(
key: string,
initialValue: MaybeRef<string>,
storage?: StorageLikeAsync,
options?: StorageAsyncOptions<string>
): RemovableRef<string>
export declare function useStorageAsync(
key: string,
initialValue: MaybeRef<boolean>,
storage?: StorageLikeAsync,
options?: StorageAsyncOptions<boolean>
): RemovableRef<boolean>
export declare function useStorageAsync(
key: string,
initialValue: MaybeRef<number>,
storage?: StorageLikeAsync,
options?: StorageAsyncOptions<number>
): RemovableRef<number>
export declare function useStorageAsync<T>(
key: string,
initialValue: MaybeRef<T>,
storage?: StorageLikeAsync,
options?: StorageAsyncOptions<T>
): RemovableRef<T>
export declare function useStorageAsync<T = unknown>(
key: string,
initialValue: MaybeRef<null>,
storage?: StorageLikeAsync,
options?: StorageAsyncOptions<T>
): RemovableRef<T>
export interface StorageAsyncOptions<T>
extends Omit<StorageOptions<T>, "serializer"> {
/**
* Custom data serialization
*/
serializer?: SerializerAsync<T>
}
export declare function useStorageAsync(
key: string,
initialValue: MaybeRef<string>,
storage?: StorageLikeAsync,
options?: StorageAsyncOptions<string>
): RemovableRef<string>
export declare function useStorageAsync(
key: string,
initialValue: MaybeRef<boolean>,
storage?: StorageLikeAsync,
options?: StorageAsyncOptions<boolean>
): RemovableRef<boolean>
export declare function useStorageAsync(
key: string,
initialValue: MaybeRef<number>,
storage?: StorageLikeAsync,
options?: StorageAsyncOptions<number>
): RemovableRef<number>
export declare function useStorageAsync<T>(
key: string,
initialValue: MaybeRef<T>,
storage?: StorageLikeAsync,
options?: StorageAsyncOptions<T>
): RemovableRef<T>
export declare function useStorageAsync<T = unknown>(
key: string,
initialValue: MaybeRef<null>,
storage?: StorageLikeAsync,
options?: StorageAsyncOptions<T>
): RemovableRef<T>
Source
Contributors
Anthony Fu
Waldi
Andreas Weber