JSConcepts

Observer vs Pub-Sub pattern

Observer

The observer pattern is a software 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.

Pub-Sub

In ‘Publisher-Subscriber’ pattern, senders of messages, called publishers, do not program the messages to be sent directly to specific receivers, called subscribers.

Difference

Reference

https://hackernoon.com/observer-vs-pub-sub-pattern-50d3b27f838c