source: imaps-frontend/node_modules/react-use/esm/useAsyncRetry.d.ts@ d565449

main
Last change on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 651 bytes
Line 
1import { DependencyList } from 'react';
2import { AsyncState } from './useAsync';
3export declare type AsyncStateRetry<T> = AsyncState<T> & {
4 retry(): void;
5};
6declare const useAsyncRetry: <T>(fn: () => Promise<T>, deps?: DependencyList) => {
7 retry: () => void;
8 loading: boolean;
9 error?: undefined;
10 value?: undefined;
11} | {
12 retry: () => void;
13 loading: false;
14 error: Error;
15 value?: undefined;
16} | {
17 retry: () => void;
18 loading: true;
19 error?: Error | undefined;
20 value?: T | undefined;
21} | {
22 retry: () => void;
23 loading: false;
24 error?: undefined;
25 value: T;
26};
27export default useAsyncRetry;
Note: See TracBrowser for help on using the repository browser.