smartenv/ts/smartenv.objectstorage.ts
2015-11-30 19:58:35 +01:00

26 lines
768 B
TypeScript

/// <reference path="index.ts" />
module SmartenvObjectStorage {
export function init() {
var obs:any = {};
var obsItems:any = {};
obs.addItem = function(objectArg,paramName = "undefined") {
if (paramName == "undefined"){
plugins.beautylog.error("paramName is undefined");
return;
}
obsItems[paramName] = objectArg;
};
obs.getItem = function(keyName) {
return obsItems[keyName];
};
obs.getComplete = function () {
return obsItems;
}
obs.addComplete = function(itemsArg) {
obsItems = plugins._.assign(obsItems,itemsArg);
return obsItems;
};
return obs;
}
}