Created
August 14, 2014 04:00
-
-
Save raineorshine/e4f79950867eea05e3c1 to your computer and use it in GitHub Desktop.
Universal Module Definition Pattern (from https://github.com/tildeio/rsvp.js/blob/master/lib/rsvp.umd.js)
This file contains 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
/* global define:true module:true window: true */ | |
if (typeof define === 'function' && define.amd) { | |
define(function() { return MYMODULE; }); | |
} else if (typeof module !== 'undefined' && module.exports) { | |
module.exports = MYMODULE; | |
} else if (typeof this !== 'undefined') { | |
this['RSVP'] = MYMODULE; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment