[jQuery] custom events for non DOM objects - possible with jQuery?

[jQuery] custom events for non DOM objects - possible with jQuery?


Hi there,
[resent from groups.google.com as the email from my client seems lost
in cyberspace]
Is it possible to use the jQuery event system to implement the
observer pattern for non-DOM objects? That is creating a non-DOM event
source object, onto which several functions or objects can attach
themselves as listeners?
I'm looking at something like the following:
===========================
var event_source = {};
event_source.bind('onCustomEvent', function(){ ... });
event_source.bind('onCustomEvent', function(){ ... });
// later
event_source.trigger('onCustomEvent');
===========================
Should I source/build something myself instead?
Thanks,
Tim.