Created
August 20, 2013 22:40
-
-
Save 8bitDesigner/6288260 to your computer and use it in GitHub Desktop.
Supporting AMD and global modules
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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