Skip to content

Instantly share code, notes, and snippets.

@ferdiemmen
Last active October 25, 2017 07:46
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 ferdiemmen/1ab7e8bf68c9df85fc4eeb91d8da6bfc to your computer and use it in GitHub Desktop.
Save ferdiemmen/1ab7e8bf68c9df85fc4eeb91d8da6bfc to your computer and use it in GitHub Desktop.
UMD-Inspired JS Module
// UMD-Inspired JS Module from https://gist.github.com/wilmoore/3880415
!function(name, context, definition) {
/* global define,module,require */
'use strict';
if (typeof exports === 'object') {
module.exports = definition(require);
} else if (typeof define === 'function' && define.amd) {
define(definition);
} else {
context[name] = definition();
}
}.call(this, 'App', this, function() {
return {
name: 'foobar',
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment