@segment/analytics-next
Version:
Analytics Next (aka Analytics 2.0) is the latest version of Segment’s JavaScript SDK - enabling you to send your data to any tool without having to learn, test, or use a new API every time.
24 lines • 723 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.MemoryStorage = void 0;
/**
* Data Storage using in memory object
*/
var MemoryStorage = /** @class */ (function () {
function MemoryStorage() {
this.cache = {};
}
MemoryStorage.prototype.get = function (key) {
var _a;
return ((_a = this.cache[key]) !== null && _a !== void 0 ? _a : null);
};
MemoryStorage.prototype.set = function (key, value) {
this.cache[key] = value;
};
MemoryStorage.prototype.remove = function (key) {
delete this.cache[key];
};
return MemoryStorage;
}());
exports.MemoryStorage = MemoryStorage;
//# sourceMappingURL=memoryStorage.js.map