Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 0.27 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. var UsefullClass = new Class({
  2.         initialize: funciton() {
  3.                 /* do something */
  4.         }
  5. });
  6.  
  7. UsefullClass.extend({
  8.  
  9.         instance: null,
  10.        
  11.         getInstance: function() {
  12.                 if (this.instance == null) {
  13.                         this.instance = new USefullClass();
  14.                 }
  15.                 return this.instance;
  16.         }
  17.  
  18. });