---
sidebar_position: 8
title: Effect
sidebar_label: Effect
---

<div class="api-link">
  <div class="api-link-title">RequestEffect</div>
  <div class="api-link-sub-title">

[Read the API Reference »](/api/Hyper-Fetch/Class/RequestEffect.mdx)

  </div>
</div>

---

## Introduction

**`RequestEffect`** is basically a set of reducers reacting to the request lifecycle. You can assign it to the Client;
its `effectKey` has to be the same as the request's effect key so you can match it.

The strength of `RequestEffect` lies in cooperation options with persistent queues. Imagine that you always want to
trigger some logic when the request is successful, but you must also use persistent storage to save ongoing requests.
But when the app gets relaunched, there is no way to persist functions and logic. Here, the effect is the solution. We
can assign it on Client creation so that it will instantly match all ongoing requests from previous sessions.

---

## Purpose

- Persists request side-effects
- Manipulates the lifecycle and allows hooking in

---

## EffectKey

A key needed to match the Effect with the request where it's stored. This is automatically generated (like other keys in
the request), but you can set up custom values for easier usage and matching.

---

## Parameters

Configuration options

{@import Hyper-Fetch RequestEffectOptionsType returns}
