unissist
Version:
A persistance library for unistore
3 lines (2 loc) • 518 B
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.unissist=e()}(this,function(){return function(t){return t=t||"unistorePersist",{getState:function(){var e;try{e=JSON.parse(localStorage.getItem(t))}catch(t){}if(null!==e)return e},setState:function(e){try{localStorage.setItem(t,JSON.stringify(e))}catch(t){}},clearState:function(){try{localStorage.removeItem(t)}catch(t){}}}}});
//# sourceMappingURL=localStorageAdapter.umd.js.map