I authored something very similar a while back called Event.Latch:

https://github.com/anutron/art-widgets/blob/master/Source/Utilities/Event.Latch.js

(in programming, a "latch" is a condition that starts out false but once set
to true remains so forever)

On Fri, Jul 22, 2011 at 1:05 AM, Agroism <[email protected]> wrote:

> If an event is fired through this special 'fireOnce' method, then all
> functions that are attached to that key/event name will be fired
> immediately.
>
> Chase Wilson
> Phone Mail. :)
>
> On Jul 22, 2011, at 12:36 AM, "Steve Onnis" <[email protected]>
> wrote:
>
> So you are saying, if you add events to something and the event has already
> fired, if you add new functions to the same event, you just want them to
> fire immediately rather than be qued?****
>
> ** **
>
> *From:* jiggliemon [mailto:[email protected]]
> *Sent:* Friday, 22 July 2011 4:46 PM
> *To:* <[email protected]>[email protected]
> *Subject:* Re: RE: [Moo] New method to Events class****
>
> ** **
>
> The point is that when the dom is ready, it's ready (why set up a new
> function queue when that function can be fired right away), and thanks to
> how the domready event is written, if you attempt to add a function to the
> domready queue post `domready` or after that event has already fired, it
> bypasses a queue, and fired that event right away:****
>
> ** **
>
> http://jsfiddle.net/jiggliemon/uN6vh/****
>
> ** **
>
> It would make sense to mimic that same functionality with the core 'Events'
> class.****
>
> ** **
>
> - Chase****
>
>

Reply via email to