move functions into its own folder and give it a set interface

This commit is contained in:
Luke Page
2014-08-16 13:17:35 +01:00
parent 953f70c879
commit d7e7ddba44
18 changed files with 807 additions and 763 deletions

View File

@@ -0,0 +1,18 @@
module.exports = {
_data: {},
add: function(name, func) {
if (this._data.hasOwnProperty(name)) {
//TODO warn
}
this._data[name] = func;
},
addMultiple: function(functions) {
Object.keys(functions).forEach(
function(name) {
this.add(name, functions[name]);
}.bind(this));
},
get: function(name) {
return this._data[name];
}
};