
How Custom Javascript Events Will Save the Universe - mcxx
http://www.slideshare.net/savetheclocktower/how-custom-events-will-save-the-universe?from=ss_embed
======
kls
I agree using a pub / sub event model can help to decouple a UI and allow
developers to build components that can be dropped in pages. For example I use
event models to notify widgets that new data is available. If someone changes
their account information I publish an account changed message and any
subscribers are get the new data and are responsible for updating their UI.
Further the one I love to use it for is analytical. When you write widgets
that you will use over and over again, I never know what analytical library
that a company will be using so setting all my track-able events up as event
publishes allows me to write a module that can subscribe to the events and
publish the data to Omniture, Unica, Google or whoever. This decouples the two
and allows the analytical to be layered on after the fact.

