Maybe someone knows more approaches to communicate between components?
I don’t get the difference between ‘Publish/Subscribe’ and ‘Custom Events’ in the article. To me it just looks like slightly different syntax for the same thing. What am I missing?
The difference is, with Custom Events you are working with Document object and each event is attached to Document, so if you have thousands it may cause some performance. In Publish/Subscribe approach you are working with Object and it is easier to unsubscribe all in one place.
Basically, both approaches are same.