UNPKG

@agnostack/requestd

Version:

Please contact agnoStack via info@agnostack.com for any questions

31 lines 1.06 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const browser_monads_ts_1 = require("browser-monads-ts"); const AbstractStorage_1 = __importDefault(require("./AbstractStorage")); const utils_1 = require("../utils"); const STORAGE_TYPE = 'sessionStorage'; class StorageSession extends AbstractStorage_1.default { constructor(config) { super(config); this.storage = browser_monads_ts_1.window[STORAGE_TYPE]; } // TODO: handle expires in setItem setItem(key, value) { this.storage.setItem(key, value); } // TODO: handle expired in getItem getItem(key) { return this.storage.getItem(key); } removeItem(key) { this.storage.removeItem(key); } static isSupported() { return (0, utils_1.testBrowserStorage)(STORAGE_TYPE); } } exports.default = StorageSession; //# sourceMappingURL=StorageSession.js.map