A design pattern in which an object, called the subject, maintains a list of its dependents, called observers and notifies them automatically of any state changes, usually by calling one of their methods.
The idea of the observer pattern is basically to have one object, which on a change of state, updates one or more other objects on the changes. We will make this much clearer when we go through an example below.
You know how messy API responses can be. Wrong data types, an inconsistent structure of response etc. Especially when it comes to error responses, backend guys forget about style and same structure of responses all over the app.