Skip to content

Instantly share code, notes, and snippets.

@pbakondy
Created January 18, 2016 12:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pbakondy/cf3b575ba82d0c032953 to your computer and use it in GitHub Desktop.
Save pbakondy/cf3b575ba82d0c032953 to your computer and use it in GitHub Desktop.
UMD wrapper
// https://toddmotto.com/what-function-window-document-undefined-iife-really-means/
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(factory);
} else if (typeof exports === 'object') {
module.exports = factory;
} else {
root.MYMODULE = factory();
}
})(this, function () {
// code
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment