Last active
August 29, 2015 13:57
-
-
Save tomalex0/9838976 to your computer and use it in GitHub Desktop.
Barebone script to start a javascript widget
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
| (function(name, definition, context) { | |
| if (typeof module != 'undefined' && module.exports) { | |
| module.exports = definition(); | |
| } else if (typeof context['define'] == 'function' && context['define']['amd']) { | |
| define(definition); | |
| } else { | |
| context[name] = definition(); | |
| } | |
| })('myWidget', function() { | |
| var myWidget = (function(param1, param2, param3){ | |
| console.log(param1); | |
| console.log(param2); | |
| }); | |
| return myWidget; | |
| }, this); | |
| //myWidget("firstparam", "secondparam", "thirdparam"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment