CodeZettaInterview Hub

Angular · Signals · Junior · Comparison

What is the difference between computed and effect?

Short Interview Answer

computed derives a memoized value; effect runs side effects when dependencies change.

Detailed Explanation

computed is pure and lazy/cached. effects are for logging, syncing imperative APIs—not for deriving state. Avoid writing to signals in ways that create cycles.

Did you know this answer?