I borrowed the ideas from Scott Kyle's work.

I made a hook so the initialize Mutator is not so expensive as well.

Singleton is now in 1.2.2

http://gist.github.com/109094



2009/5/10 Fábio Costa <fabiomco...@gmail.com>

> This looks like a static class more than the singleton pattern.
>
>
> Fábio Miranda Costa
> Engenheiro de Computação
> http://meiocodigo.com
>
>
>
> On Sun, May 10, 2009 at 4:31 PM, Christoph Pojer <
> christoph.po...@gmail.com> wrote:
>
>>
>> As JavaScript doesn't really have the concept of a Singleton I think
>> the easiest way to use it is just to do something like var MySingleton
>> = new new Class({ ... }). This creates a class and directly one single
>> instance of it. Of course, you can't subclass it or use the new
>> operator with it again, but thats not the point here :)
>>
>> On May 7, 5:16 pm, Paul Spencer <pagam...@gmail.com> wrote:
>> > anyone successfully tried nwhite's singleton mutator [1] with the
>> > latest mootools?  I'd love to use it but it doesn't seem to be working
>> > for me using the example provided ... I tried to follow the code to
>> > see if I could figure out what is going wrong, but its beyond me in my
>> > present uncaffeinated state of mind :(
>> >
>> > Cheers
>> >
>> > Paul
>> >
>> > [1]http://www.nwhite.net/2008/10/10/mootools-singleton-class-mutator/
>>
>
>

Reply via email to