react-use/lib/useAsync.d.ts
2018-10-28 14:30:17 +01:00

8 lines
202 B
TypeScript

export interface AsyncState<T> {
loading: boolean;
error?: Error | any;
value?: T;
}
declare const useAsync: <T>(fn: () => Promise<T>, args?: any) => AsyncState<T>;
export default useAsync;