diff options
Diffstat (limited to 'src/hooks/useRequests.tsx')
| -rw-r--r-- | src/hooks/useRequests.tsx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/hooks/useRequests.tsx b/src/hooks/useRequests.tsx index 5ac70a4..cb85162 100644 --- a/src/hooks/useRequests.tsx +++ b/src/hooks/useRequests.tsx | |||
| @@ -57,6 +57,7 @@ export interface useRequestsProps { | |||
| 57 | export interface UseRequests { | 57 | export interface UseRequests { |
| 58 | calls: RequestResponse[] | 58 | calls: RequestResponse[] |
| 59 | readyState: ReadyState | 59 | readyState: ReadyState |
| 60 | clear: () => void | ||
| 60 | } | 61 | } |
| 61 | 62 | ||
| 62 | export default function useRequests({ onConnect }: useRequestsProps): UseRequests { | 63 | export default function useRequests({ onConnect }: useRequestsProps): UseRequests { |
| @@ -124,5 +125,9 @@ export default function useRequests({ onConnect }: useRequestsProps): UseRequest | |||
| 124 | response: responses.find(({id}) => id === request.id) | 125 | response: responses.find(({id}) => id === request.id) |
| 125 | })), [requests, responses]), | 126 | })), [requests, responses]), |
| 126 | readyState, | 127 | readyState, |
| 128 | clear: () => { | ||
| 129 | setRequests([]) | ||
| 130 | setResponses([]) | ||
| 131 | } | ||
| 127 | } | 132 | } |
| 128 | } | 133 | } |
