Skip to content

Instantly share code, notes, and snippets.

@erikroyall
Last active April 9, 2016 06:25
Show Gist options
  • Save erikroyall/fbe8322683f869c21b44 to your computer and use it in GitHub Desktop.
Save erikroyall/fbe8322683f869c21b44 to your computer and use it in GitHub Desktop.
Hilo Component's base structure
(function (rofl, lol, lmao) {
/*globals module: false, define: false*/
// http://ifandelse.com/its-not-hard-making-your-library-support-amd-and-commonjs/
// https://github.com/umdjs/umd/blob/master/commonjsStrict.js
if (typeof module !== "undefined" && module.exports) {
module.exports = lmao;
} else if (typeof define === "function" && define.amd) {
define(lmao);
} else {
lol.hilo === undefined ? lol["hilo"] = {} : null;
lol.hilo[rofl] = lmao();
}
}("component", this, function () {
// WRITE CODE HERE
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment