Hacker News new | ask | show | jobs
by whisk3rs 3811 days ago
It is part of the Observer pattern: https://en.wikipedia.org/wiki/Observer_pattern

One common use case is in workflow systems. For example, you might "wait" for a bunch of files to exist before kicking off a job. This could be implemented as a bunch of "subjects" notifying when the files exist, and then the "observer" taking action when all of its subjects notify.

It is also used in UI frameworks to update visual representation when underlying data changes.