ng2-webstorage
Advanced tools
Comparing version 1.5.0 to 1.5.1
@@ -152,3 +152,7 @@ (function (global, factory) { | ||
var value = WebStorageHelper.retrieveFromStorage(sType, sKey); | ||
if (value != null && value !== this.cached[sType][sKey]) { | ||
if (value === null) { | ||
delete this.cached[sType][sKey]; | ||
StorageObserverHelper.emit(sType, sKey, null); | ||
} | ||
else if (value !== this.cached[sType][sKey]) { | ||
this.cached[sType][sKey] = value; | ||
@@ -402,2 +406,3 @@ StorageObserverHelper.emit(sType, sKey, value); | ||
}))); | ||
}))); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29yZS51bWQuanMiLCJzb3VyY2VzIjpbIi4uL2Rpc3QvZW51bXMvc3RvcmFnZS5qcyIsIi4uL2Rpc3QvY29uc3RhbnRzL2xpYi5qcyIsIi4uL2Rpc3QvaGVscGVycy9rZXlTdG9yYWdlLmpzIiwiLi4vZGlzdC9oZWxwZXJzL3N0b3JhZ2VPYnNlcnZlci5qcyIsIi4uL2Rpc3QvaGVscGVycy9tb2NrU3RvcmFnZS5qcyIsIi4uL2Rpc3QvaGVscGVycy93ZWJTdG9yYWdlLmpzIiwiLi4vZGlzdC9zZXJ2aWNlcy93ZWJTdG9yYWdlLmpzIiwiLi4vZGlzdC9zZXJ2aWNlcy9sb2NhbFN0b3JhZ2UuanMiLCIuLi9kaXN0L3NlcnZpY2VzL3Nlc3Npb25TdG9yYWdlLmpzIiwiLi4vZGlzdC9pbnRlcmZhY2VzL2NvbmZpZy5qcyIsIi4uL2Rpc3QvZGVjb3JhdG9ycy93ZWJTdG9yYWdlLmpzIiwiLi4vZGlzdC9kZWNvcmF0b3JzL2xvY2FsU3RvcmFnZS5qcyIsIi4uL2Rpc3QvZGVjb3JhdG9ycy9zZXNzaW9uU3RvcmFnZS5qcyIsIi4uL2Rpc3QvYXBwLmpzIl0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCB2YXIgU1RPUkFHRTt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ICAgICB2YXIgc3RvcmFnZSA9IHt9O1xyXG4gICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0aWVzKHN0b3JhZ2UsIHtcclxuICAgICAgICAgICAgc2V0SXRlbToge1xyXG4gICAgICAgICAgICAgICAgd3JpdGFibGU6IGZhbHNlLFxyXG4gICAgICAgICAgICAgICAgZW51bWVyYWJsZTogZmFsc2UsXHJcbiAgICAgICAgICAgICAgICBjb25maWd1cmFibGU6IGZhbHNlLFxyXG4gICAgICAgICAgICAgICAgdmFsdWU6IGZ1bmN0aW9uIChrZXksIHZhbHVlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFNb2NrU3RvcmFnZUhlbHBlci5pc1NlY3VyZWRGaWVsZChrZXkpKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzW2tleV0gPSB2YWx1ZTtcclxuICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIGdldEl0ZW06IHtcclxuICAgICAgICAgICAgICAgIHdyaXRhYmxlOiBmYWxzZSxcclxuICAgICAgICAgICAgICAgIGVudW1lcmFibGU6IGZhbHNlLFxyXG4gICAgICAgICAgICAgICAgY29uZmlndXJhYmxlOiBmYWxzZSxcclxuICAgICAgICAgICAgICAgIHZhbHVlOiBmdW5jdGlvbiAoa2V5KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICFNb2NrU3RvcmFnZUhlbHBlci5pc1NlY3VyZWRGaWVsZChrZXkpID8gdGhpc1trZXldIHx8IG51bGwgOiBudWxsO1xyXG4gICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgcmVtb3ZlSXRlbToge1xyXG4gICAgICAgICAgICAgICAgd3JpdGFibGU6IGZhbHNlLFxyXG4gICAgICAgICAgICAgICAgZW51bWVyYWJsZTogZmFsc2UsXHJcbiAgICAgICAgICAgICAgICBjb25maWd1cmFibGU6IGZhbHNlLFxyXG4gICAgICAgICAgICAgICAgdmFsdWU6IGZ1bmN0aW9uIChrZXkpIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoIU1vY2tTdG9yYWdlSGVscGVyLmlzU2VjdXJlZEZpZWxkKGtleSkpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSB0aGlzW2tleV07XHJcbiAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBsZW5ndGg6IHtcclxuICAgICAgICAgICAgICAgIGVudW1lcmFibGU6IGZhbHNlLFxyXG4gICAgICAgICAgICAgICAgY29uZmlndXJhYmxlOiBmYWxzZSxcclxuICAgICAgICAgICAgICAgIGdldDogZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBPYmplY3Qua2V5cyh0aGlzKS5sZW5ndGg7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KTtcclxuICAgICAgICByZXR1cm4gc3RvcmFnZTtcclxuICAgIH07XHJcbiAgICBNb2NrU3RvcmFnZUhlbHBlci5zZWN1cmVkRmllbGRzID0gWydzZXRJdGVtJywgJ2dldEl0ZW0nLCAncmVtb3ZlSXRlbScsICdsZW5ndGgnXTtcclxuICAgIE1vY2tTdG9yYWdlSGVscGVyLm1vY2tTdG9yYWdlcyA9IHt9O1xyXG4gICAgcmV0dXJuIE1vY2tTdG9yYWdlSGVscGVyO1xyXG59KCkpO1xyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1tb2NrU3RvcmFnZS5qcy5tYXAiLCJpbXBvcnQgeyBTVE9SQUdFIH0gZnJvbSAnLi4vZW51bXMvc3RvcmFnZSc7XHJcbmltcG9ydCB7IFN0b3JhZ2VPYnNlcnZlckhlbHBlciB9IGZyb20gJy4vc3RvcmFnZU9ic2VydmVyJztcclxuaW1wb3J0IHsgS2V5U3RvcmFnZUhlbHBlciB9IGZyb20gJy4va2V5U3Rvcm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ldyBPcGFxdWVUb2tlbignV0VCU1RPUkFHRV9DT05GSUcnKTtcclxuZXhwb3J0IHZhciBOZzJXZWJzdG9yYWdlID0gKGZ1bmN0aW9uICgpIHtcclxuICAgIGZ1bmN0aW9uIE5nMldlYnN0b3JhZ2Uobmdab25lLCBjb25maWcpIHtcclxuICAgICAgICB0aGlzLm5nWm9uZSA9IG5nWm9uZTtcclxuICAgICAgICBpZiAoY29uZmlnKSB7XHJcbiAgICAgICAgICAgIEtleVN0b3JhZ2VIZWxwZXIuc2V0U3RvcmFnZUtleVByZWZpeChjb25maWcucHJlZml4KTtcclxuICAgICAgICAgICAgS2V5U3RvcmFnZUhlbHBlci5zZXRTdG9yYWdlS2V5U2VwYXJhdG9yKGNvbmZpZy5zZXBhcmF0b3IpO1xyXG4gICAgICAgIH1cclxuICAgICAgICB0aGlzLmluaXRTdG9yYWdlTGlzdGVuZXIoKTtcclxuICAgIH1cclxuICAgIE5nMldlYnN0b3JhZ2UuZm9yUm9vdCA9IGZ1bmN0aW9uIChjb25maWcpIHtcclxuICAgICAgICByZXR1cm4ge1xyXG4gICAgICAgICAgICBuZ01vZHVsZTogTmcyV2Vic3RvcmFnZSxcclxuICAgICAgICAgICAgcHJvdmlkZXJzOiBbXHJcbiAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgcHJvdmlkZTogV0VCU1RPUkFHRV9DT05GSUcsXHJcbiAgICAgICAgICAgICAgICAgICAgdXNlVmFsdWU6IGNvbmZpZ1xyXG4gICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICBwcm92aWRlOiBXZWJzdG9yYWdlQ29uZmlnLFxyXG4gICAgICAgICAgICAgICAgICAgIHVzZUZhY3Rvcnk6IHByb3ZpZGVDb25maWcsXHJcbiAgICAgICAgICAgICAgICAgICAgZGVwczogW1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBXRUJTVE9SQUdFX0NPTkZJR1xy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FhLENBQUMsTUFBTSxFQUFFO0lBQ2xDLE9BQU8sSUFBSSxnQkFBZ0IsQ0FBQyxNQUFNLENBQUMsQ0FBQztDQUN2QztBQUNELEFBQU8sU0FBUyxTQUFTLENBQUMsRUFBRSxFQUFFO0lBQzFCLElBQUksRUFBRSxHQUFHLEVBQUUsS0FBSyxLQUFLLENBQUMsR0FBRyxFQUFFLE1BQU0sRUFBRSxPQUFPLEVBQUUsU0FBUyxFQUFFLGlCQUFpQixFQUFFLEdBQUcsRUFBRSxFQUFFLE1BQU0sR0FBRyxFQUFFLENBQUMsTUFBTSxFQUFFLFNBQVMsR0FBRyxFQUFFLENBQUMsU0FBUyxDQUFDOztJQUU5SCxPQUFPLENBQUMsSUFBSSxDQUFDLG1IQUFtSCxDQUFDLENBQUM7SUFDbEksZ0JBQWdCLENBQUMsbUJBQW1CLENBQUMsTUFBTSxDQUFDLENBQUM7SUFDN0MsZ0JBQWdCLENBQUMsc0JBQXNCLENBQUMsU0FBUyxDQUFDLENBQUM7Q0FDdEQsQUFDRCw7Ozs7Ozs7Ozs7Ozs7LDs7LDs7In0= |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core")):"function"==typeof define&&define.amd?define(["exports","@angular/core"],t):t(e.ng2Webstorage=e.ng2Webstorage||{},e.ng.core)}(this,function(e,t){"use strict";function r(e,t){return function(t,r){o(e,c.local,t,r)}}function o(e,t,r,o){var n=e||o;Object.defineProperty(r,o,{get:function(){var e=h.genKey(n);return S.retrieve(t,e)},set:function(e){var r=h.genKey(n);this[r]=e,S.store(t,r,e)}})}function n(e){return function(t,r){o(e,c.local,t,r)}}function i(e){return function(t,r){o(e,c.session,t,r)}}function s(e){return new I(e)}function a(e){var t=void 0===e?{prefix:l,separator:f}:e,r=t.prefix,o=t.separator;console.warn("[ng2-webstorage:deprecation] The configure method is deprecated since the v1.5.0, consider to use forRoot instead"),h.setStorageKeyPrefix(r),h.setStorageKeySeparator(o)}var c;!function(e){e[e.local=0]="local",e[e.session=1]="session"}(c||(c={}));var u,l="ng2-webstorage",f="|",g=(u={},u[c.local]="local",u[c.session]="session",u),p=l,v=f,h=function(){function e(){}return e.isManagedKey=function(e){return 0===e.indexOf(p+v)},e.retrieveKeysFromStorage=function(e){return Object.keys(e).filter(function(e){return 0===e.indexOf(p)})},e.genKey=function(e){if("string"!=typeof e)throw Error("attempt to generate a storage key with a non string value");return""+p+v+e.toString().toLowerCase()},e.setStorageKeyPrefix=function(e){void 0===e&&(e=l),p=e},e.setStorageKeySeparator=function(e){void 0===e&&(e=f),v=e},e}(),d=function(){function e(){}return e.observe=function(e,r){var o=this.genObserverKey(e,r);return o in this.observers?this.observers[o]:this.observers[o]=new t.EventEmitter},e.emit=function(e,t,r){var o=this.genObserverKey(e,t);o in this.observers&&this.observers[o].emit(r)},e.genObserverKey=function(e,t){return e+"|"+t},e.observers={},e}(),y=function(){function e(){}return e.isSecuredField=function(t){return!!~e.securedFields.indexOf(t)},e.getStorage=function(t){return this.mockStorages[t]||(this.mockStorages[t]=e.generateStorage()),this.mockStorages[t]},e.generateStorage=function(){var t={};return Object.defineProperties(t,{setItem:{writable:!1,enumerable:!1,configurable:!1,value:function(t,r){e.isSecuredField(t)||(this[t]=r)}},getItem:{writable:!1,enumerable:!1,configurable:!1,value:function(t){return e.isSecuredField(t)?null:this[t]||null}},removeItem:{writable:!1,enumerable:!1,configurable:!1,value:function(t){e.isSecuredField(t)||delete this[t]}},length:{enumerable:!1,configurable:!1,get:function(){return Object.keys(this).length}}}),t},e.securedFields=["setItem","getItem","removeItem","length"],e.mockStorages={},e}(),S=function(){function e(){}return e.store=function(e,t,r){this.getStorage(e).setItem(t,JSON.stringify(r)),this.cached[e][t]=r,d.emit(e,t,r)},e.retrieve=function(t,r){return this.cached[t][r]?this.cached[t][r]:this.cached[t][r]=e.retrieveFromStorage(t,r)},e.retrieveFromStorage=function(e,t){var r=null;try{r=JSON.parse(this.getStorage(e).getItem(t))}catch(e){console.warn("invalid value for "+t)}return r},e.refresh=function(t,r){if(h.isManagedKey(r)){var o=e.retrieveFromStorage(t,r);null!=o&&o!==this.cached[t][r]&&(this.cached[t][r]=o,d.emit(t,r,o))}},e.clearAll=function(e){var t=this,r=this.getStorage(e);h.retrieveKeysFromStorage(r).forEach(function(o){r.removeItem(o),delete t.cached[e][o],d.emit(e,o,null)})},e.clear=function(e,t){this.getStorage(e).removeItem(t),delete this.cached[e][t],d.emit(e,t,null)},e.getStorage=function(e){return this.isStorageAvailable(e)?this.getWStorage(e):y.getStorage(e)},e.getWStorage=function(e){var t;switch(e){case c.local:t=localStorage;break;case c.session:t=sessionStorage;break;default:throw Error("invalid storage type")}return t},e.isStorageAvailable=function(e){if("boolean"==typeof this.storageAvailability[e])return this.storageAvailability[e];var t=!0,r=this.getWStorage(e);if("object"==typeof r)try{r.setItem("test-storage","foobar"),r.removeItem("test-storage")}catch(e){t=!1}else t=!1;return t||console.warn(g[e]+" storage unavailable, Ng2Webstorage will use a fallback strategy instead"),this.storageAvailability[e]=t},e.cached=(t={},t[c.local]={},t[c.session]={},t),e.storageAvailability=(r={},r[c.local]=null,r[c.session]=null,r),e;var t,r}(),b=function(){function e(e){void 0===e&&(e=null),this.sType=e,this.sType=e}return e.prototype.store=function(e,t){var r=h.genKey(e);S.store(this.sType,r,t)},e.prototype.retrieve=function(e){var t=h.genKey(e);return S.retrieve(this.sType,t)},e.prototype.clear=function(e){e?S.clear(this.sType,h.genKey(e)):S.clearAll(this.sType)},e.prototype.observe=function(e){var t=h.genKey(e);return d.observe(this.sType,t)},e}(),m=function(e,t){function r(){this.constructor=e}for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},w=function(e){function r(){e.call(this,c.local)}return m(r,e),r.decorators=[{type:t.Injectable}],r.ctorParameters=function(){return[]},r}(b),O=function(e,t){function r(){this.constructor=e}for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},K=function(e){function r(){e.call(this,c.session)}return O(r,e),r.decorators=[{type:t.Injectable}],r.ctorParameters=function(){return[]},r}(b),I=function(){function e(e){this.prefix=l,this.separator=f,e&&void 0!==e.prefix&&(this.prefix=e.prefix),e&&void 0!==e.separator&&(this.separator=e.separator)}return e}(),x=new t.OpaqueToken("WEBSTORAGE_CONFIG"),F=function(){function e(e,t){this.ngZone=e,t&&(h.setStorageKeyPrefix(t.prefix),h.setStorageKeySeparator(t.separator)),this.initStorageListener()}return e.forRoot=function(t){return{ngModule:e,providers:[{provide:x,useValue:t},{provide:I,useFactory:s,deps:[x]}]}},e.prototype.initStorageListener=function(){var e=this;window&&window.addEventListener("storage",function(t){return e.ngZone.run(function(){var e=window.sessionStorage===t.storageArea?c.session:c.local;S.refresh(e,t.key)})})},e.decorators=[{type:t.NgModule,args:[{declarations:[],providers:[K,w],imports:[]}]}],e.ctorParameters=function(){return[{type:t.NgZone},{type:I,decorators:[{type:t.Optional},{type:t.Inject,args:[I]}]}]},e}();e.WEBSTORAGE_CONFIG=x,e.Ng2Webstorage=F,e.provideConfig=s,e.configure=a,e.WebstorageConfig=I,e.LocalStorage=n,e.SessionStorage=i,e.WebStorage=r,e.WebStorageDecorator=o,e.WebStorageService=b,e.LocalStorageService=w,e.SessionStorageService=K,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core")):"function"==typeof define&&define.amd?define(["exports","@angular/core"],t):t(e.ng2Webstorage=e.ng2Webstorage||{},e.ng.core)}(this,function(e,t){"use strict";function r(e,t){return function(t,r){o(e,c.local,t,r)}}function o(e,t,r,o){var n=e||o;Object.defineProperty(r,o,{get:function(){var e=v.genKey(n);return S.retrieve(t,e)},set:function(e){var r=v.genKey(n);this[r]=e,S.store(t,r,e)}})}function n(e){return function(t,r){o(e,c.local,t,r)}}function i(e){return function(t,r){o(e,c.session,t,r)}}function s(e){return new I(e)}function a(e){var t=void 0===e?{prefix:l,separator:f}:e,r=t.prefix,o=t.separator;console.warn("[ng2-webstorage:deprecation] The configure method is deprecated since the v1.5.0, consider to use forRoot instead"),v.setStorageKeyPrefix(r),v.setStorageKeySeparator(o)}var c;!function(e){e[e.local=0]="local",e[e.session=1]="session"}(c||(c={}));var u,l="ng2-webstorage",f="|",g=(u={},u[c.local]="local",u[c.session]="session",u),p=l,h=f,v=function(){function e(){}return e.isManagedKey=function(e){return 0===e.indexOf(p+h)},e.retrieveKeysFromStorage=function(e){return Object.keys(e).filter(function(e){return 0===e.indexOf(p)})},e.genKey=function(e){if("string"!=typeof e)throw Error("attempt to generate a storage key with a non string value");return""+p+h+e.toString().toLowerCase()},e.setStorageKeyPrefix=function(e){void 0===e&&(e=l),p=e},e.setStorageKeySeparator=function(e){void 0===e&&(e=f),h=e},e}(),d=function(){function e(){}return e.observe=function(e,r){var o=this.genObserverKey(e,r);return o in this.observers?this.observers[o]:this.observers[o]=new t.EventEmitter},e.emit=function(e,t,r){var o=this.genObserverKey(e,t);o in this.observers&&this.observers[o].emit(r)},e.genObserverKey=function(e,t){return e+"|"+t},e.observers={},e}(),y=function(){function e(){}return e.isSecuredField=function(t){return!!~e.securedFields.indexOf(t)},e.getStorage=function(t){return this.mockStorages[t]||(this.mockStorages[t]=e.generateStorage()),this.mockStorages[t]},e.generateStorage=function(){var t={};return Object.defineProperties(t,{setItem:{writable:!1,enumerable:!1,configurable:!1,value:function(t,r){e.isSecuredField(t)||(this[t]=r)}},getItem:{writable:!1,enumerable:!1,configurable:!1,value:function(t){return e.isSecuredField(t)?null:this[t]||null}},removeItem:{writable:!1,enumerable:!1,configurable:!1,value:function(t){e.isSecuredField(t)||delete this[t]}},length:{enumerable:!1,configurable:!1,get:function(){return Object.keys(this).length}}}),t},e.securedFields=["setItem","getItem","removeItem","length"],e.mockStorages={},e}(),S=function(){function e(){}return e.store=function(e,t,r){this.getStorage(e).setItem(t,JSON.stringify(r)),this.cached[e][t]=r,d.emit(e,t,r)},e.retrieve=function(t,r){return this.cached[t][r]?this.cached[t][r]:this.cached[t][r]=e.retrieveFromStorage(t,r)},e.retrieveFromStorage=function(e,t){var r=null;try{r=JSON.parse(this.getStorage(e).getItem(t))}catch(e){console.warn("invalid value for "+t)}return r},e.refresh=function(t,r){if(v.isManagedKey(r)){var o=e.retrieveFromStorage(t,r);null===o?(delete this.cached[t][r],d.emit(t,r,null)):o!==this.cached[t][r]&&(this.cached[t][r]=o,d.emit(t,r,o))}},e.clearAll=function(e){var t=this,r=this.getStorage(e);v.retrieveKeysFromStorage(r).forEach(function(o){r.removeItem(o),delete t.cached[e][o],d.emit(e,o,null)})},e.clear=function(e,t){this.getStorage(e).removeItem(t),delete this.cached[e][t],d.emit(e,t,null)},e.getStorage=function(e){return this.isStorageAvailable(e)?this.getWStorage(e):y.getStorage(e)},e.getWStorage=function(e){var t;switch(e){case c.local:t=localStorage;break;case c.session:t=sessionStorage;break;default:throw Error("invalid storage type")}return t},e.isStorageAvailable=function(e){if("boolean"==typeof this.storageAvailability[e])return this.storageAvailability[e];var t=!0,r=this.getWStorage(e);if("object"==typeof r)try{r.setItem("test-storage","foobar"),r.removeItem("test-storage")}catch(e){t=!1}else t=!1;return t||console.warn(g[e]+" storage unavailable, Ng2Webstorage will use a fallback strategy instead"),this.storageAvailability[e]=t},e.cached=(t={},t[c.local]={},t[c.session]={},t),e.storageAvailability=(r={},r[c.local]=null,r[c.session]=null,r),e;var t,r}(),b=function(){function e(e){void 0===e&&(e=null),this.sType=e,this.sType=e}return e.prototype.store=function(e,t){var r=v.genKey(e);S.store(this.sType,r,t)},e.prototype.retrieve=function(e){var t=v.genKey(e);return S.retrieve(this.sType,t)},e.prototype.clear=function(e){e?S.clear(this.sType,v.genKey(e)):S.clearAll(this.sType)},e.prototype.observe=function(e){var t=v.genKey(e);return d.observe(this.sType,t)},e}(),m=function(e,t){function r(){this.constructor=e}for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},w=function(e){function r(){e.call(this,c.local)}return m(r,e),r.decorators=[{type:t.Injectable}],r.ctorParameters=function(){return[]},r}(b),O=function(e,t){function r(){this.constructor=e}for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},K=function(e){function r(){e.call(this,c.session)}return O(r,e),r.decorators=[{type:t.Injectable}],r.ctorParameters=function(){return[]},r}(b),I=function(){function e(e){this.prefix=l,this.separator=f,e&&void 0!==e.prefix&&(this.prefix=e.prefix),e&&void 0!==e.separator&&(this.separator=e.separator)}return e}(),x=new t.OpaqueToken("WEBSTORAGE_CONFIG"),F=function(){function e(e,t){this.ngZone=e,t&&(v.setStorageKeyPrefix(t.prefix),v.setStorageKeySeparator(t.separator)),this.initStorageListener()}return e.forRoot=function(t){return{ngModule:e,providers:[{provide:x,useValue:t},{provide:I,useFactory:s,deps:[x]}]}},e.prototype.initStorageListener=function(){var e=this;window&&window.addEventListener("storage",function(t){return e.ngZone.run(function(){var e=window.sessionStorage===t.storageArea?c.session:c.local;S.refresh(e,t.key)})})},e.decorators=[{type:t.NgModule,args:[{declarations:[],providers:[K,w],imports:[]}]}],e.ctorParameters=function(){return[{type:t.NgZone},{type:I,decorators:[{type:t.Optional},{type:t.Inject,args:[I]}]}]},e}();e.WEBSTORAGE_CONFIG=x,e.Ng2Webstorage=F,e.provideConfig=s,e.configure=a,e.WebstorageConfig=I,e.LocalStorage=n,e.SessionStorage=i,e.WebStorage=r,e.WebStorageDecorator=o,e.WebStorageService=b,e.LocalStorageService=w,e.SessionStorageService=K,Object.defineProperty(e,"__esModule",{value:!0})}); |
@@ -33,3 +33,7 @@ import { STORAGE } from '../enums/storage'; | ||
var value = WebStorageHelper.retrieveFromStorage(sType, sKey); | ||
if (value != null && value !== this.cached[sType][sKey]) { | ||
if (value === null) { | ||
delete this.cached[sType][sKey]; | ||
StorageObserverHelper.emit(sType, sKey, null); | ||
} | ||
else if (value !== this.cached[sType][sKey]) { | ||
this.cached[sType][sKey] = value; | ||
@@ -36,0 +40,0 @@ StorageObserverHelper.emit(sType, sKey, value); |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{"WebStorageHelper":{"__symbolic":"class","statics":{"cached":{"__symbolic":"error","message":"Expression form not supported","line":9,"character":18},"storageAvailability":{"__symbolic":"error","message":"Expression form not supported","line":10,"character":31},"getStorage":{"__symbolic":"function","parameters":["sType"],"value":{"__symbolic":"if","condition":{"__symbolic":"error","message":"Expression form not supported","line":62,"character":9},"thenExpression":{"__symbolic":"error","message":"Expression form not supported","line":62,"character":42},"elseExpression":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"./mockStorage","name":"MockStorageHelper"},"member":"getStorage"},"arguments":[{"__symbolic":"reference","name":"sType"}]}}}}}}},{"__symbolic":"module","version":1,"metadata":{"WebStorageHelper":{"__symbolic":"class","statics":{"cached":{"__symbolic":"error","message":"Expression form not supported","line":9,"character":18},"storageAvailability":{"__symbolic":"error","message":"Expression form not supported","line":10,"character":31},"getStorage":{"__symbolic":"function","parameters":["sType"],"value":{"__symbolic":"if","condition":{"__symbolic":"error","message":"Expression form not supported","line":62,"character":9},"thenExpression":{"__symbolic":"error","message":"Expression form not supported","line":62,"character":42},"elseExpression":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"./mockStorage","name":"MockStorageHelper"},"member":"getStorage"},"arguments":[{"__symbolic":"reference","name":"sType"}]}}}}}}}] | ||
[{"__symbolic":"module","version":3,"metadata":{"WebStorageHelper":{"__symbolic":"class","statics":{"cached":{"__symbolic":"error","message":"Expression form not supported","line":9,"character":18},"storageAvailability":{"__symbolic":"error","message":"Expression form not supported","line":10,"character":31},"getStorage":{"__symbolic":"function","parameters":["sType"],"value":{"__symbolic":"if","condition":{"__symbolic":"error","message":"Expression form not supported","line":66,"character":9},"thenExpression":{"__symbolic":"error","message":"Expression form not supported","line":66,"character":42},"elseExpression":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"./mockStorage","name":"MockStorageHelper"},"member":"getStorage"},"arguments":[{"__symbolic":"reference","name":"sType"}]}}}}}}},{"__symbolic":"module","version":1,"metadata":{"WebStorageHelper":{"__symbolic":"class","statics":{"cached":{"__symbolic":"error","message":"Expression form not supported","line":9,"character":18},"storageAvailability":{"__symbolic":"error","message":"Expression form not supported","line":10,"character":31},"getStorage":{"__symbolic":"function","parameters":["sType"],"value":{"__symbolic":"if","condition":{"__symbolic":"error","message":"Expression form not supported","line":66,"character":9},"thenExpression":{"__symbolic":"error","message":"Expression form not supported","line":66,"character":42},"elseExpression":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"./mockStorage","name":"MockStorageHelper"},"member":"getStorage"},"arguments":[{"__symbolic":"reference","name":"sType"}]}}}}}}}] |
{ | ||
"name": "ng2-webstorage", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"description": "angular2 webstorage manager", | ||
@@ -5,0 +5,0 @@ "main": "bundles/core.umd.js", |
@@ -18,2 +18,3 @@ # ng2-webstorage | ||
* [@SessionStorage](#d_sessionStorage) | ||
* [Known issues](#knownissues) | ||
* [Modify and build](#modifBuild) | ||
@@ -298,2 +299,28 @@ | ||
### <a name="knownissues">Known issues</a> | ||
-------------------- | ||
- *Serialization doesn't work for objects:* | ||
Ng2Webstorage's decorators are based upon accessors so the update trigger only on assignation. | ||
Consequence, if you change the value of a bound object's property the new model will not be store properly. The same thing will happen with a push into a bound array. | ||
To handle this cases you have to trigger manually the accessor. | ||
````typescript | ||
import {LocalStorage} from 'ng2-webstorage'; | ||
class FooBar { | ||
@LocalStorage('prop') | ||
myArray; | ||
updateValue() { | ||
this.myArray.push('foobar'); | ||
this.myArray = this.myArray; //does the trick | ||
} | ||
} | ||
```` | ||
### <a name="modifBuild">Modify and build</a> | ||
@@ -309,2 +336,1 @@ -------------------- | ||
*Start the dev server:* `npm run dev` then go to *http://localhost:8080/webpack-dev-server/index.html* | ||
Sorry, the diff of this file is not supported yet
257113
1094
334