Correct, Currently there is no buffering of event triggers when no subscribers exist in the module.
I wouldn't expect that to be a common use case (only saw it used once) and could it be handled by a closured var inside the addEventListener override? Sent on the TELUS Mobility network with BlackBerry -----Original Message----- From: Filip Maj <[email protected]> Date: Thu, 1 Dec 2011 14:03:29 To: [email protected]<[email protected]> Reply-To: [email protected] Subject: Re: [DISCUSS] Switching out Channel's in callback-js for an event module Love it. Also slightly smaller :D I also prefer this API over the channel one. Especially the `once` or `join` function - dependencies as FIRST argument, not last :/ One thing, though: I saw in the bootstrap there was some comment about a hack regarding registering to an event that has already fired - this is key in phonegap currently but I do not think is supported right now in your implementation. Is that correct? On 11-12-01 1:48 PM, "Gord Tanner" <[email protected]> wrote: >Please see reference branch here: >https://github.com/gtanner/callback-js/tree/event > >One of the issues with Channel's in a module based system is that it is >awkward to keep track to a central repository of channel objects. > >I coded up a quick prototype using an event module. This gives us the >ability to trigger and sync on events by just using a string (rather than >an instance created before hand). It cleans up some of the code and >doesn't >require the pre-construction of all the channels before hand. > >See tests here: >https://github.com/gtanner/callback-js/blob/event/test/test.event.js > >See use case here: >https://github.com/gtanner/callback-js/blob/event/lib/bootstrap.js > > >---- >Gord Tanner >Code Poet >RIM >@gordtanner
