Skip to content
JavaScript·Intermediate·Conceptual·1 min read

What is the observer pattern actually decoupling?

Short interview answer

It decouples the code that produces an event or change from the code that reacts to it — publishers don't need to know who's listening, and subscribers don't need to know who's publishing, only the shared event contract between them.

Key takeaway

Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.

← Back to JavaScript design patterns

Related questions