Skip to content

Instantly share code, notes, and snippets.

@collinprice
Last active August 29, 2015 13:57
Show Gist options
  • Save collinprice/9522057 to your computer and use it in GitHub Desktop.
Save collinprice/9522057 to your computer and use it in GitHub Desktop.
Bare bones JavaScript library. Refer to http://www.uploadify.com/.
// Library name that is accessible from the global scope.
window.myLib = (function(){
// Can encapsulate my object.
function MyLib(config) {
}
// Object that will be returned from global access.
var myLib = {
// Functions can be added here.
start: function (config) {
console.log('start');
// return new MyLib(config);
var settings = {
option1: 'alpha',
option2: false,
option3: 3
}
for (var attr in config) {
settings[attr] = config[attr];
}
return settings;
}
};
return myLib;
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment