Skip to content

Instantly share code, notes, and snippets.

@8bitDesigner
Created August 20, 2013 22:40
Show Gist options
  • Select an option

  • Save 8bitDesigner/6288260 to your computer and use it in GitHub Desktop.

Select an option

Save 8bitDesigner/6288260 to your computer and use it in GitHub Desktop.
Supporting AMD and global modules
function MyClass() {
// ...
}
// AMD and window support
if (typeof define === "function") {
define(function () { return new MyClass(); });
} else if (typeof global.alertify === "undefined") {
global.myClass = new myClass();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment