JavaScript·Advanced·Coding·1 min read
Is React's Context API an implementation of the observer pattern?
Short interview answer
It shares similarities — providers publish a value and consumers subscribe to changes — but Context updates propagate through React's render cycle rather than a manually managed listener list, so it's more accurate to call it dependency injection with observer-like update propagation.
Key takeaway
Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.