Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
How Custom Javascript Events Will Save the Universe (slideshare.net)
2 points by mcxx on June 25, 2010 | hide | past | favorite | 1 comment


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.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: