Last active
October 25, 2017 07:46
-
-
Save ferdiemmen/1ab7e8bf68c9df85fc4eeb91d8da6bfc to your computer and use it in GitHub Desktop.
UMD-Inspired JS Module
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
// 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