main
Last change
on this file 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
|
Rev | Line | |
---|
[d565449] | 1 | import { DependencyList } from 'react';
|
---|
| 2 | import { AsyncState } from './useAsync';
|
---|
| 3 | export declare type AsyncStateRetry<T> = AsyncState<T> & {
|
---|
| 4 | retry(): void;
|
---|
| 5 | };
|
---|
| 6 | declare 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 | };
|
---|
| 27 | export default useAsyncRetry;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.