Created
January 18, 2016 12:34
-
-
Save pbakondy/cf3b575ba82d0c032953 to your computer and use it in GitHub Desktop.
UMD wrapper
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
// 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