Use `computed()` when you need a derived value: ```ts total = computed(() => this.items().reduce((sum, item) => sum + item.price, 0)); ``` `computed()` is pure, cached, and should derive values such as totals, filtered lists, or status flags. Use `effect()` only when a signal change must trigger an external side effect: ```ts effect(() => { localStorage.setItem('theme', this.theme()); }); ``` Typical uses include logging, `localStorage` synchronization, and DOM manipulation. Never update sign...
Scanned 9/5/2026
Install to Claude Code
npx -y skills add HoangNguyen0403/agent-skills-standard --skill angular-state-management --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Angular State Management?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/hoangnguyen0403-angular-state-management-329ba678)More formats (shields.io, HTML) on the badges page.
Use `computed()` when you need a derived value:
```ts
total = computed(() => this.items().reduce((sum, item) => sum + item.price, 0));
```
`computed()` is pure, cached, and should derive values such as totals, filtered lists, or status flags.
Use `effect()` only when a signal change must trigger an external side effect:
```ts
effect(() => {
localStorage.setItem('theme', this.theme());
});
```
Typical uses include logging, `localStorage` synchronization, and DOM manipulation. Never update signals inside `effect()`; this can cause circular dependencies.
If you need dependent writable state that resets when its source changes, use `linkedSignal()` instead:
```ts
selectedItem = linkedSignal(() => this.items()[0] ?? null);
```
Rule of thumb: value transformation → `computed()`; interaction with something outside the signal graph → `effect()`.
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!