Filed Under: JavaScript
Having spent a few years making Flex applications it was a bit of a shift to return to making HTML/CSS/JavaScript based applications. One of the things I really missed was the ability to create loosely coupled componenten using custom events.
You do have the option of using jQuery Custom Events, but without depending on a library there is no option of creating custom events in JavaScript. Custom events in jQuery have a slight performance hit and therefor it made sense to create a dead simple Publish Subscribe pattern implementation in JS.
Here are the requirements:
Grab the source on GitHub on let me know what you think.
Subscribe to comments feed (this is global, not just for this entry)