Observer
A way of notifying change to a number of classes.
The Observer pattern offers a subscription model in which objects subscribe to an event and get notified when the event occurs.
This pattern is the cornerstone of event driven programming, including JavaScript.
The Observer pattern facilitates good object-oriented design and promotes loose coupling.
When building web apps you end up writing many event handlers. Event handlers are functions that will be notified when a certain event fires.
These notifications optionally receive an event argument with details about the event.
Last updated
Was this helpful?