react-async-hook
Advanced tools
Comparing version 3.5.0 to 3.5.1
@@ -0,1 +1,2 @@ | ||
declare type UnknownArgs = unknown[]; | ||
export declare type AsyncStateStatus = 'not-requested' | 'loading' | 'success' | 'error'; | ||
@@ -26,3 +27,3 @@ export declare type AsyncState<R> = { | ||
export declare type UseAsyncOptions<R> = Partial<UseAsyncOptionsNormalized<R>> | undefined | null; | ||
export declare type UseAsyncReturn<R, Args extends any[] = never> = AsyncState<R> & { | ||
export declare type UseAsyncReturn<R, Args extends any[] = UnknownArgs> = AsyncState<R> & { | ||
set: (value: AsyncState<R>) => void; | ||
@@ -34,7 +35,7 @@ reset: () => void; | ||
}; | ||
export declare function useAsync<R, Args extends any[]>(asyncFunction: () => Promise<R>, params: Args, options?: UseAsyncOptions<R>): UseAsyncReturn<R, Args>; | ||
export declare function useAsync<R, Args extends any[]>(asyncFunction: (...args: Args) => Promise<R>, params: Args, options?: UseAsyncOptions<R>): UseAsyncReturn<R, Args>; | ||
export declare function useAsync<R, Args extends any[] = UnknownArgs>(asyncFunction: () => Promise<R>, params: Args, options?: UseAsyncOptions<R>): UseAsyncReturn<R, Args>; | ||
export declare function useAsync<R, Args extends any[] = UnknownArgs>(asyncFunction: (...args: Args) => Promise<R>, params: Args, options?: UseAsyncOptions<R>): UseAsyncReturn<R, Args>; | ||
declare type AddArg<H, T extends any[]> = ((h: H, ...t: T) => void) extends ((...r: infer R) => void) ? R : never; | ||
export declare const useAsyncAbortable: <R, Args extends any[]>(asyncFunction: (...args: AddArg<AbortSignal, Args>) => Promise<R>, params: Args, options?: UseAsyncOptions<R>) => UseAsyncReturn<R, Args>; | ||
export declare const useAsyncCallback: <R, Args extends any[]>(asyncFunction: (...args: Args) => MaybePromise<R>) => UseAsyncReturn<R, Args>; | ||
export declare const useAsyncAbortable: <R, Args extends any[] = unknown[]>(asyncFunction: (...args: AddArg<AbortSignal, Args>) => Promise<R>, params: Args, options?: UseAsyncOptions<R>) => UseAsyncReturn<R, Args>; | ||
export declare const useAsyncCallback: <R, Args extends any[] = unknown[]>(asyncFunction: (...args: Args) => MaybePromise<R>) => UseAsyncReturn<R, Args>; | ||
export {}; |
{ | ||
"name": "react-async-hook", | ||
"version": "3.5.0", | ||
"version": "3.5.1", | ||
"description": "Async hook", | ||
@@ -5,0 +5,0 @@ "author": "Sébastien Lorber", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
145283
543