# effect()

*noun*

say it: **“ih-FEKT”** **/ɪˈfɛkt/**

An Angular function that runs code again whenever the signals it reads change.

## What does `effect()` do?

`effect()` runs code whenever the signals it reads change. Use it for side effects like saving to local storage or logging, not for calculating values.

```typescript
constructor() {
  effect(() => localStorage.setItem('theme', this.theme()));
}
```

## In a sentence

- “An **effect** saves the cart to local storage every time it changes.”

Level: Journeyman · [More Angular terms at this level](https://www.ask-codey.com/glossary?category=angular&level=3)

Updated: November 9, 2026

Source: https://www.ask-codey.com/glossary/effect
