@manojadams/session-store
Advanced tools
Comparing version 1.0.11 to 1.0.12
@@ -1,4 +0,2 @@ | ||
import LocalStore from "./store/LocalStore"; | ||
import SessionStore from "./store/SessionStore"; | ||
export { SessionStore, LocalStore }; | ||
export default SessionStore; |
@@ -1,2 +0,2 @@ | ||
function t(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,e(t,n)}function e(t,n){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},e(t,n)}function n(t,e,i){if(!t.s){if(i instanceof o){if(!i.s)return void(i.o=n.bind(null,t,e));1&e&&(e=i.s),i=i.v}if(i&&i.then)return void i.then(n.bind(null,t,e),n.bind(null,t,2));t.s=e,t.v=i;var s=t.o;s&&s(t)}}var i=/*#__PURE__*/function(e){function i(t){var n;return(n=e.call(this,t,sessionStorage)||this).isStoreReady=void 0,n._deps=void 0,n.isStoreReady=!1,n._deps=[].slice.call(arguments,1),n}t(i,e);var r=i.prototype;return r.setStoreType=function(t){this._storeType=t},r.init=function(){try{var t=this;if(e.prototype.init.call(t),t.isStoreReady)return Promise.resolve();var i=function(){if(t._deps){var e=0,i=function(t,e,i){for(var r;;){var a=t();if(s(a)&&(a=a.v),!a)return h;if(a.then){r=0;break}var h=i();if(h&&h.then){if(!s(h)){r=1;break}h=h.s}if(e){var u=e();if(u&&u.then&&!s(u)){r=2;break}}}var c=new o,d=n.bind(null,c,2);return(0===r?a.then(p):1===r?h.then(f):u.then(v)).then(void 0,d),c;function f(o){h=o;do{if(e&&(u=e())&&u.then&&!s(u))return void u.then(v).then(void 0,d);if(!(a=t())||s(a)&&!a.v)return void n(c,1,h);if(a.then)return void a.then(p).then(void 0,d);s(h=i())&&(h=h.v)}while(!h||!h.then);h.then(f).then(void 0,d)}function p(t){t?(h=i())&&h.then?h.then(f).then(void 0,d):f(h):n(c,1,h)}function v(){(a=t())?a.then?a.then(p).then(void 0,d):p(a):n(c,1,h)}}(function(){return e<t._deps.length},function(){return e++},function(){return Promise.resolve(t._deps[e].init()).then(function(){})});if(i&&i.then)return i.then(function(){})}}();return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(t){return Promise.reject(t)}},r.destroy=function(){if(e.prototype.destroy.call(this),this._deps)for(var t=0;t<this._deps.length;t++)this._deps[t].destroy();this.isStoreReady=!1},i}(/*#__PURE__*/function(){function t(t,e){this._storeType=void 0,this._sessionData=void 0,this._name=void 0,this._createdAt=void 0,this._updatedAt=void 0,this.isReady=void 0,this._name=t||this.constructor.name,this._storeType=e||sessionStorage,this._sessionData={},this._createdAt=new Date,this._updatedAt=new Date,this.isReady=!1}var e=t.prototype;return e.init=function(t){var e=this._storeType.getItem(this._name);e&&(this._sessionData=JSON.parse(e),this.isReady=!0)},e.getData=function(t){return this._sessionData[t]},e.setData=function(t,e){this._sessionData[t]=e,this._updatedAt=new Date},e._cleanup=function(){var t=this._sessionData._createdAt||this._createdAt.toISOString(),e=this._updatedAt.toISOString();this._sessionData._createdAt=t,this._sessionData._updatedAt=e},e.destroy=function(){this._cleanup(),this._storeType.setItem(this._name,JSON.stringify(this._sessionData))},t}());const o=/*#__PURE__*/function(){function t(){}return t.prototype.then=function(e,i){const o=new t,s=this.s;if(s){const t=1&s?e:i;if(t){try{n(o,1,t(this.v))}catch(t){n(o,2,t)}return o}return this}return this.o=function(t){try{const s=t.v;1&t.s?n(o,1,e?e(s):s):i?n(o,1,i(s)):n(o,2,s)}catch(t){n(o,2,t)}},o},t}();function s(t){return t instanceof o&&1&t.s}exports.LocalStore=/*#__PURE__*/function(e){function n(t){var n;return(n=e.call.apply(e,[this,t].concat([].slice.call(arguments,1)))||this).setStoreType(localStorage),n}return t(n,e),n}(i),exports.SessionStore=i,exports.default=i; | ||
function t(e,n){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},t(e,n)}function e(t,n,r){if(!t.s){if(r instanceof i){if(!r.s)return void(r.o=e.bind(null,t,n));1&n&&(n=r.s),r=r.v}if(r&&r.then)return void r.then(e.bind(null,t,n),e.bind(null,t,2));t.s=n,t.v=r;var s=t.o;s&&s(t)}}var n=/*#__PURE__*/function(n){var s,o;function a(t){var e;return(e=n.call(this,t)||this).isStoreReady=void 0,e._deps=void 0,e.isStoreReady=!1,e._deps=[].slice.call(arguments,1),e}o=n,(s=a).prototype=Object.create(o.prototype),s.prototype.constructor=s,t(s,o);var h=a.prototype;return h.setStoreType=function(t){this._storeType=t},h.init=function(){try{var t=this;if(n.prototype.init.call(t),t.isStoreReady)return Promise.resolve();var s=function(){if(t._deps){var n=0,s=function(t,n,s){for(var o;;){var a=t();if(r(a)&&(a=a.v),!a)return h;if(a.then){o=0;break}var h=s();if(h&&h.then){if(!r(h)){o=1;break}h=h.s}if(n){var u=n();if(u&&u.then&&!r(u)){o=2;break}}}var c=new i,d=e.bind(null,c,2);return(0===o?a.then(v):1===o?h.then(f):u.then(p)).then(void 0,d),c;function f(i){h=i;do{if(n&&(u=n())&&u.then&&!r(u))return void u.then(p).then(void 0,d);if(!(a=t())||r(a)&&!a.v)return void e(c,1,h);if(a.then)return void a.then(v).then(void 0,d);r(h=s())&&(h=h.v)}while(!h||!h.then);h.then(f).then(void 0,d)}function v(t){t?(h=s())&&h.then?h.then(f).then(void 0,d):f(h):e(c,1,h)}function p(){(a=t())?a.then?a.then(v).then(void 0,d):v(a):e(c,1,h)}}(function(){return n<t._deps.length},function(){return n++},function(){return Promise.resolve(t._deps[n].init()).then(function(){})});if(s&&s.then)return s.then(function(){})}}();return Promise.resolve(s&&s.then?s.then(function(){}):void 0)}catch(t){return Promise.reject(t)}},h.destroy=function(){if(n.prototype.destroy.call(this),this._deps)for(var t=0;t<this._deps.length;t++)this._deps[t].destroy();this.isReady=!1,this.isStoreReady=!1},a}(/*#__PURE__*/function(){function t(t,e){this._storeType=void 0,this._sessionData=void 0,this._name=void 0,this._createdAt=void 0,this._updatedAt=void 0,this.isReady=void 0,this._name=t||this.constructor.name,this._storeType=e,this._sessionData={},this._createdAt=new Date,this._updatedAt=new Date,this.isReady=!1}var e=t.prototype;return e.init=function(t){try{var e=this,n=(e._storeType||sessionStorage).getItem(e._name);return n&&(e._sessionData=JSON.parse(n),e.isReady=!0),Promise.resolve()}catch(t){return Promise.reject(t)}},e.getData=function(t){return this._sessionData[t]},e.setData=function(t,e){this._sessionData[t]=e,this._updatedAt=new Date},e._cleanup=function(){var t=this._sessionData._createdAt||this._createdAt.toISOString(),e=this._updatedAt.toISOString();this._sessionData._createdAt=t,this._sessionData._updatedAt=e},e.destroy=function(){this._cleanup(),(this._storeType||sessionStorage).setItem(this._name,JSON.stringify(this._sessionData))},t}());const i=/*#__PURE__*/function(){function t(){}return t.prototype.then=function(n,i){const r=new t,s=this.s;if(s){const t=1&s?n:i;if(t){try{e(r,1,t(this.v))}catch(t){e(r,2,t)}return r}return this}return this.o=function(t){try{const s=t.v;1&t.s?e(r,1,n?n(s):s):i?e(r,1,i(s)):e(r,2,s)}catch(t){e(r,2,t)}},r},t}();function r(t){return t instanceof i&&1&t.s}module.exports=n; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
function t(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,e(t,n)}function e(t,n){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},e(t,n)}function n(t,e,i){if(!t.s){if(i instanceof s){if(!i.s)return void(i.o=n.bind(null,t,e));1&e&&(e=i.s),i=i.v}if(i&&i.then)return void i.then(n.bind(null,t,e),n.bind(null,t,2));t.s=e,t.v=i;var o=t.o;o&&o(t)}}var i=/*#__PURE__*/function(e){function i(t){var n;return(n=e.call(this,t,sessionStorage)||this).isStoreReady=void 0,n._deps=void 0,n.isStoreReady=!1,n._deps=[].slice.call(arguments,1),n}t(i,e);var r=i.prototype;return r.setStoreType=function(t){this._storeType=t},r.init=function(){try{var t=this;if(e.prototype.init.call(t),t.isStoreReady)return Promise.resolve();var i=function(){if(t._deps){var e=0,i=function(t,e,i){for(var r;;){var a=t();if(o(a)&&(a=a.v),!a)return h;if(a.then){r=0;break}var h=i();if(h&&h.then){if(!o(h)){r=1;break}h=h.s}if(e){var u=e();if(u&&u.then&&!o(u)){r=2;break}}}var c=new s,d=n.bind(null,c,2);return(0===r?a.then(v):1===r?h.then(f):u.then(p)).then(void 0,d),c;function f(s){h=s;do{if(e&&(u=e())&&u.then&&!o(u))return void u.then(p).then(void 0,d);if(!(a=t())||o(a)&&!a.v)return void n(c,1,h);if(a.then)return void a.then(v).then(void 0,d);o(h=i())&&(h=h.v)}while(!h||!h.then);h.then(f).then(void 0,d)}function v(t){t?(h=i())&&h.then?h.then(f).then(void 0,d):f(h):n(c,1,h)}function p(){(a=t())?a.then?a.then(v).then(void 0,d):v(a):n(c,1,h)}}(function(){return e<t._deps.length},function(){return e++},function(){return Promise.resolve(t._deps[e].init()).then(function(){})});if(i&&i.then)return i.then(function(){})}}();return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(t){return Promise.reject(t)}},r.destroy=function(){if(e.prototype.destroy.call(this),this._deps)for(var t=0;t<this._deps.length;t++)this._deps[t].destroy();this.isStoreReady=!1},i}(/*#__PURE__*/function(){function t(t,e){this._storeType=void 0,this._sessionData=void 0,this._name=void 0,this._createdAt=void 0,this._updatedAt=void 0,this.isReady=void 0,this._name=t||this.constructor.name,this._storeType=e||sessionStorage,this._sessionData={},this._createdAt=new Date,this._updatedAt=new Date,this.isReady=!1}var e=t.prototype;return e.init=function(t){var e=this._storeType.getItem(this._name);e&&(this._sessionData=JSON.parse(e),this.isReady=!0)},e.getData=function(t){return this._sessionData[t]},e.setData=function(t,e){this._sessionData[t]=e,this._updatedAt=new Date},e._cleanup=function(){var t=this._sessionData._createdAt||this._createdAt.toISOString(),e=this._updatedAt.toISOString();this._sessionData._createdAt=t,this._sessionData._updatedAt=e},e.destroy=function(){this._cleanup(),this._storeType.setItem(this._name,JSON.stringify(this._sessionData))},t}());const s=/*#__PURE__*/function(){function t(){}return t.prototype.then=function(e,i){const s=new t,o=this.s;if(o){const t=1&o?e:i;if(t){try{n(s,1,t(this.v))}catch(t){n(s,2,t)}return s}return this}return this.o=function(t){try{const o=t.v;1&t.s?n(s,1,e?e(o):o):i?n(s,1,i(o)):n(s,2,o)}catch(t){n(s,2,t)}},s},t}();function o(t){return t instanceof s&&1&t.s}var r=/*#__PURE__*/function(e){function n(t){var n;return(n=e.call.apply(e,[this,t].concat([].slice.call(arguments,1)))||this).setStoreType(localStorage),n}return t(n,e),n}(i);export{r as LocalStore,i as SessionStore,i as default}; | ||
function t(e,n){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},t(e,n)}function e(t,n,r){if(!t.s){if(r instanceof i){if(!r.s)return void(r.o=e.bind(null,t,n));1&n&&(n=r.s),r=r.v}if(r&&r.then)return void r.then(e.bind(null,t,n),e.bind(null,t,2));t.s=n,t.v=r;var s=t.o;s&&s(t)}}var n=/*#__PURE__*/function(n){var s,o;function a(t){var e;return(e=n.call(this,t)||this).isStoreReady=void 0,e._deps=void 0,e.isStoreReady=!1,e._deps=[].slice.call(arguments,1),e}o=n,(s=a).prototype=Object.create(o.prototype),s.prototype.constructor=s,t(s,o);var h=a.prototype;return h.setStoreType=function(t){this._storeType=t},h.init=function(){try{var t=this;if(n.prototype.init.call(t),t.isStoreReady)return Promise.resolve();var s=function(){if(t._deps){var n=0,s=function(t,n,s){for(var o;;){var a=t();if(r(a)&&(a=a.v),!a)return h;if(a.then){o=0;break}var h=s();if(h&&h.then){if(!r(h)){o=1;break}h=h.s}if(n){var u=n();if(u&&u.then&&!r(u)){o=2;break}}}var c=new i,d=e.bind(null,c,2);return(0===o?a.then(v):1===o?h.then(f):u.then(p)).then(void 0,d),c;function f(i){h=i;do{if(n&&(u=n())&&u.then&&!r(u))return void u.then(p).then(void 0,d);if(!(a=t())||r(a)&&!a.v)return void e(c,1,h);if(a.then)return void a.then(v).then(void 0,d);r(h=s())&&(h=h.v)}while(!h||!h.then);h.then(f).then(void 0,d)}function v(t){t?(h=s())&&h.then?h.then(f).then(void 0,d):f(h):e(c,1,h)}function p(){(a=t())?a.then?a.then(v).then(void 0,d):v(a):e(c,1,h)}}(function(){return n<t._deps.length},function(){return n++},function(){return Promise.resolve(t._deps[n].init()).then(function(){})});if(s&&s.then)return s.then(function(){})}}();return Promise.resolve(s&&s.then?s.then(function(){}):void 0)}catch(t){return Promise.reject(t)}},h.destroy=function(){if(n.prototype.destroy.call(this),this._deps)for(var t=0;t<this._deps.length;t++)this._deps[t].destroy();this.isReady=!1,this.isStoreReady=!1},a}(/*#__PURE__*/function(){function t(t,e){this._storeType=void 0,this._sessionData=void 0,this._name=void 0,this._createdAt=void 0,this._updatedAt=void 0,this.isReady=void 0,this._name=t||this.constructor.name,this._storeType=e,this._sessionData={},this._createdAt=new Date,this._updatedAt=new Date,this.isReady=!1}var e=t.prototype;return e.init=function(t){try{var e=this,n=(e._storeType||sessionStorage).getItem(e._name);return n&&(e._sessionData=JSON.parse(n),e.isReady=!0),Promise.resolve()}catch(t){return Promise.reject(t)}},e.getData=function(t){return this._sessionData[t]},e.setData=function(t,e){this._sessionData[t]=e,this._updatedAt=new Date},e._cleanup=function(){var t=this._sessionData._createdAt||this._createdAt.toISOString(),e=this._updatedAt.toISOString();this._sessionData._createdAt=t,this._sessionData._updatedAt=e},e.destroy=function(){this._cleanup(),(this._storeType||sessionStorage).setItem(this._name,JSON.stringify(this._sessionData))},t}());const i=/*#__PURE__*/function(){function t(){}return t.prototype.then=function(n,i){const r=new t,s=this.s;if(s){const t=1&s?n:i;if(t){try{e(r,1,t(this.v))}catch(t){e(r,2,t)}return r}return this}return this.o=function(t){try{const s=t.v;1&t.s?e(r,1,n?n(s):s):i?e(r,1,i(s)):e(r,2,s)}catch(t){e(r,2,t)}},r},t}();function r(t){return t instanceof i&&1&t.s}export{n as default}; | ||
//# sourceMappingURL=index.modern.js.map |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t||self).sessionStore={})}(this,function(t){function e(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,n(t,e)}function n(t,e){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},n(t,e)}function i(t,e,n){if(!t.s){if(n instanceof s){if(!n.s)return void(n.o=i.bind(null,t,e));1&e&&(e=n.s),n=n.v}if(n&&n.then)return void n.then(i.bind(null,t,e),i.bind(null,t,2));t.s=e,t.v=n;var o=t.o;o&&o(t)}}var o=/*#__PURE__*/function(t){function n(e){var n;return(n=t.call(this,e,sessionStorage)||this).isStoreReady=void 0,n._deps=void 0,n.isStoreReady=!1,n._deps=[].slice.call(arguments,1),n}e(n,t);var o=n.prototype;return o.setStoreType=function(t){this._storeType=t},o.init=function(){try{var e=this;if(t.prototype.init.call(e),e.isStoreReady)return Promise.resolve();var n=function(){if(e._deps){var t=0,n=function(t,e,n){for(var o;;){var a=t();if(r(a)&&(a=a.v),!a)return h;if(a.then){o=0;break}var h=n();if(h&&h.then){if(!r(h)){o=1;break}h=h.s}if(e){var u=e();if(u&&u.then&&!r(u)){o=2;break}}}var c=new s,f=i.bind(null,c,2);return(0===o?a.then(p):1===o?h.then(d):u.then(v)).then(void 0,f),c;function d(o){h=o;do{if(e&&(u=e())&&u.then&&!r(u))return void u.then(v).then(void 0,f);if(!(a=t())||r(a)&&!a.v)return void i(c,1,h);if(a.then)return void a.then(p).then(void 0,f);r(h=n())&&(h=h.v)}while(!h||!h.then);h.then(d).then(void 0,f)}function p(t){t?(h=n())&&h.then?h.then(d).then(void 0,f):d(h):i(c,1,h)}function v(){(a=t())?a.then?a.then(p).then(void 0,f):p(a):i(c,1,h)}}(function(){return t<e._deps.length},function(){return t++},function(){return Promise.resolve(e._deps[t].init()).then(function(){})});if(n&&n.then)return n.then(function(){})}}();return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(t){return Promise.reject(t)}},o.destroy=function(){if(t.prototype.destroy.call(this),this._deps)for(var e=0;e<this._deps.length;e++)this._deps[e].destroy();this.isStoreReady=!1},n}(/*#__PURE__*/function(){function t(t,e){this._storeType=void 0,this._sessionData=void 0,this._name=void 0,this._createdAt=void 0,this._updatedAt=void 0,this.isReady=void 0,this._name=t||this.constructor.name,this._storeType=e||sessionStorage,this._sessionData={},this._createdAt=new Date,this._updatedAt=new Date,this.isReady=!1}var e=t.prototype;return e.init=function(t){var e=this._storeType.getItem(this._name);e&&(this._sessionData=JSON.parse(e),this.isReady=!0)},e.getData=function(t){return this._sessionData[t]},e.setData=function(t,e){this._sessionData[t]=e,this._updatedAt=new Date},e._cleanup=function(){var t=this._sessionData._createdAt||this._createdAt.toISOString(),e=this._updatedAt.toISOString();this._sessionData._createdAt=t,this._sessionData._updatedAt=e},e.destroy=function(){this._cleanup(),this._storeType.setItem(this._name,JSON.stringify(this._sessionData))},t}());const s=/*#__PURE__*/function(){function t(){}return t.prototype.then=function(e,n){const o=new t,s=this.s;if(s){const t=1&s?e:n;if(t){try{i(o,1,t(this.v))}catch(t){i(o,2,t)}return o}return this}return this.o=function(t){try{const s=t.v;1&t.s?i(o,1,e?e(s):s):n?i(o,1,n(s)):i(o,2,s)}catch(t){i(o,2,t)}},o},t}();function r(t){return t instanceof s&&1&t.s}var a=/*#__PURE__*/function(t){function n(e){var n;return(n=t.call.apply(t,[this,e].concat([].slice.call(arguments,1)))||this).setStoreType(localStorage),n}return e(n,t),n}(o);t.LocalStore=a,t.SessionStore=o,t.default=o}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t||self).sessionStore=e()}(this,function(){function t(e,n){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},t(e,n)}function e(t,n,o){if(!t.s){if(o instanceof i){if(!o.s)return void(o.o=e.bind(null,t,n));1&n&&(n=o.s),o=o.v}if(o&&o.then)return void o.then(e.bind(null,t,n),e.bind(null,t,2));t.s=n,t.v=o;var s=t.o;s&&s(t)}}var n=/*#__PURE__*/function(n){var s,r;function a(t){var e;return(e=n.call(this,t)||this).isStoreReady=void 0,e._deps=void 0,e.isStoreReady=!1,e._deps=[].slice.call(arguments,1),e}r=n,(s=a).prototype=Object.create(r.prototype),s.prototype.constructor=s,t(s,r);var h=a.prototype;return h.setStoreType=function(t){this._storeType=t},h.init=function(){try{var t=this;if(n.prototype.init.call(t),t.isStoreReady)return Promise.resolve();var s=function(){if(t._deps){var n=0,s=function(t,n,s){for(var r;;){var a=t();if(o(a)&&(a=a.v),!a)return h;if(a.then){r=0;break}var h=s();if(h&&h.then){if(!o(h)){r=1;break}h=h.s}if(n){var u=n();if(u&&u.then&&!o(u)){r=2;break}}}var c=new i,d=e.bind(null,c,2);return(0===r?a.then(v):1===r?h.then(f):u.then(p)).then(void 0,d),c;function f(i){h=i;do{if(n&&(u=n())&&u.then&&!o(u))return void u.then(p).then(void 0,d);if(!(a=t())||o(a)&&!a.v)return void e(c,1,h);if(a.then)return void a.then(v).then(void 0,d);o(h=s())&&(h=h.v)}while(!h||!h.then);h.then(f).then(void 0,d)}function v(t){t?(h=s())&&h.then?h.then(f).then(void 0,d):f(h):e(c,1,h)}function p(){(a=t())?a.then?a.then(v).then(void 0,d):v(a):e(c,1,h)}}(function(){return n<t._deps.length},function(){return n++},function(){return Promise.resolve(t._deps[n].init()).then(function(){})});if(s&&s.then)return s.then(function(){})}}();return Promise.resolve(s&&s.then?s.then(function(){}):void 0)}catch(t){return Promise.reject(t)}},h.destroy=function(){if(n.prototype.destroy.call(this),this._deps)for(var t=0;t<this._deps.length;t++)this._deps[t].destroy();this.isReady=!1,this.isStoreReady=!1},a}(/*#__PURE__*/function(){function t(t,e){this._storeType=void 0,this._sessionData=void 0,this._name=void 0,this._createdAt=void 0,this._updatedAt=void 0,this.isReady=void 0,this._name=t||this.constructor.name,this._storeType=e,this._sessionData={},this._createdAt=new Date,this._updatedAt=new Date,this.isReady=!1}var e=t.prototype;return e.init=function(t){try{var e=this,n=(e._storeType||sessionStorage).getItem(e._name);return n&&(e._sessionData=JSON.parse(n),e.isReady=!0),Promise.resolve()}catch(t){return Promise.reject(t)}},e.getData=function(t){return this._sessionData[t]},e.setData=function(t,e){this._sessionData[t]=e,this._updatedAt=new Date},e._cleanup=function(){var t=this._sessionData._createdAt||this._createdAt.toISOString(),e=this._updatedAt.toISOString();this._sessionData._createdAt=t,this._sessionData._updatedAt=e},e.destroy=function(){this._cleanup(),(this._storeType||sessionStorage).setItem(this._name,JSON.stringify(this._sessionData))},t}());const i=/*#__PURE__*/function(){function t(){}return t.prototype.then=function(n,i){const o=new t,s=this.s;if(s){const t=1&s?n:i;if(t){try{e(o,1,t(this.v))}catch(t){e(o,2,t)}return o}return this}return this.o=function(t){try{const s=t.v;1&t.s?e(o,1,n?n(s):s):i?e(o,1,i(s)):e(o,2,s)}catch(t){e(o,2,t)}},o},t}();function o(t){return t instanceof i&&1&t.s}return n}); | ||
//# sourceMappingURL=index.umd.js.map |
@@ -7,3 +7,3 @@ import { IStore } from "./../../constants"; | ||
declare abstract class BaseSessionStore<T> { | ||
protected _storeType: Storage; | ||
protected _storeType: Storage | undefined; | ||
protected _sessionData: T & IStore; | ||
@@ -15,3 +15,3 @@ protected _name: string; | ||
constructor(_name?: string, _storeType?: Storage); | ||
init(deps?: any): void; | ||
init(deps?: any): Promise<void>; | ||
protected getData(dataKey: keyof T): (T & IStore)[keyof T]; | ||
@@ -18,0 +18,0 @@ protected setData(dataKey: keyof T, value: any): void; |
{ | ||
"name": "@manojadams/session-store", | ||
"version": "1.0.11", | ||
"version": "1.0.12", | ||
"description": "State management with session-storage/local-storage", | ||
@@ -28,3 +28,6 @@ "main": "./dist/index.js", | ||
"react", | ||
"session-storage" | ||
"next", | ||
"session-storage", | ||
"local-storage", | ||
"data-persistence" | ||
], | ||
@@ -31,0 +34,0 @@ "author": "manojgetwealthy", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40042
124