You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: hooks/useRetry/README.md
+47-4Lines changed: 47 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -3,20 +3,54 @@
3
3
A React hook that simplifies retrying failed service calls.
4
4
5
5
## Usage
6
-
`useRetry` is designed to be used in tandem with [useLoadData](../useLoadData/). This hook will trigger `retry` from errored [retry response objects](../../types/RetryResponse.ts), and only those responses.
6
+
`useRetry` exposes a wrapped version of [useLoadData](../useLoadData/) that retries any and all errored [retry response objects](../../types/RetryResponse), and only those responses created, from that exposed version of _useLoadData_.
In addition, a list of any `useLoadData` responses can be passed as arguments (not just responses returned by the wrapped version of `useLoadData`) and when the `retry` function is called, any failed responses will be retried.
|`useLoadData`|`typeof useLoadData`| Modified version of [useLoadData]('../useLoadData'). |
89
+
|`retry`|`() => void`| Retries any retry response created by the _useLoadData_ exposed with this hook in addition to retrying errored retry responses passsed into this hook. |
90
+
|`isMaxRetry`|`boolean`| True if any retry response either passed or created via the useLoadData exposed in this hook has reached it's _isMaxRetry_|
0 commit comments