3 ms·
It is part of the Observer pattern: https://en.wikipedia.org/wiki/Observer_pattern https://en.wikipedia.org/wiki/Observer_pattern One common use case is in wor
by whisk3rs 11y ago
It is part of the Observer pattern: https://en.wikipedia.org/wiki/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.