You can re-fire the even whenever you want though so what is the point?
window.fireEvent(“domready”) From: jiggliemon [mailto:[email protected]] Sent: Friday, 22 July 2011 4:20 PM To: [email protected] Subject: [Moo] New method to Events class I'm proposing a new method for the Events module for Moo2, The name is up for grabs, but I'll call it `fireOnce` for lack of a better name. This method's behavior is analogous to the `domready` event, in that it allows a stack of events to be queued up, and then fired - all subsequent efforts to add events to that particular key, will be fired immediately - not queued. Sometimes you only need an event should only fire once; as is the case with `domready`; Queuing events on `domready` post ready is a useless effort because the dom is only ready once. We handle all subsequent efforts to attach events to the `domready` event by firing it right away. An example of needing this method would be if you're loading a template/js file asynchronously. You may want to fire event after the template is loaded, or parse the javascript prior to evaluating it, so you might create an event like `template.loaded` and queue up events for when the template is available to parse. If you have two asynchronous events, say you're loading two template files, and one depends on the other before you can inject it into the dom, it requires a series of checks before you can procede with injection. Here's a quick fiddle demonstrating how such a method works (note this is not the Mootools Events class): http://jsfiddle.net/jiggliemon/Yq7Qn/ Here's using the core Events class, firing an event on an interval: http://jsfiddle.net/jiggliemon/Yq7Qn/2/ Here's my quick hack to the core Events class: https://gist.github.com/1098976 - Chase
