Skip to main content

computed(), effect(), equality and dependencies

Learn computed(), effect(), equality and dependencies (Module 13 · Angular Signals, Angular) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

computed() and derived state • Derived state is anything you can calculate from other state (totals, filtered lists). Do not store it separately; compute it. • computed() creates a read-only signal from a formula. Like a spreadsheet formula cell: it recalculates when its inputs change, and caches the result otherwise. • effect() runs code (a side effect: logging, saving, calling a library) whenever the signals it reads change.

More lessons in Module 13 · Angular Signals