z-helper
Version:
A collection of libraries that I use in a lot of projects, feel free to modify them for your use.
21 lines (15 loc) • 401 B
JavaScript
const globalDataStore = new Instance()
function Instance() {
const dataStore = {}
this.get = function(key) {
return dataStore[key] === undefined ? null : dataStore[key]
}
this.set = function(key, value) {
dataStore[key] = value
return this
}
}
module.exports.set = globalDataStore.set
module.exports.get = globalDataStore.get
module.exports.Instance = Instance