Last active
August 29, 2015 13:57
-
-
Save collinprice/9522057 to your computer and use it in GitHub Desktop.
Bare bones JavaScript library. Refer to http://www.uploadify.com/.
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
// 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