The observer pattern is a behavioral design pattern that allows an object (the observer) to notify other subscribed objects about any events that has occurred on the object they’re observing.
When should I use this?
- When the change of a state in one object must be reflected in another object without keeping the objects tightly dependent on one another.
