---
url: https://haihv.github.io/valifetch/api/index/type-aliases/BeforeRetryState.md
---

# Type Alias: BeforeRetryState

> **BeforeRetryState** = [`RetryContext`](RetryContext.md) & `object`

Defined in: [src/types/hooks.ts:41](https://github.com/haihv/valifetch/blob/285835d38a6676b98d2ee1a93e23166c6c834cb2/src/types/hooks.ts#L41)

State passed to `beforeRetry` hooks.

Extends [RetryContext](RetryContext.md) with the normalized request options. Exactly one
of `response` / `error` is set, discriminated by `reason`. Return a new
`Request` from the hook to replace `request` for the remaining attempts.

## Type Declaration

### options

> **options**: [`NormalizedOptions`](NormalizedOptions.md)

Normalized request options
