UNPKG

@lomray/react-mobx-manager

Version:
3 lines (2 loc) 458 B
class t{globalKey;storage;cookieAttr;constructor({storage:t,cookieAttr:e,globalKey:s}){this.storage=t,this.cookieAttr=e??{},this.globalKey=s??"stores"}get(){try{return JSON.parse(this.storage.get(this.globalKey)||"{}")}catch(t){return{}}}flush(){return this.storage.remove(this.globalKey,this.cookieAttr)}set(t){return this.storage.set(this.globalKey,JSON.stringify(t||"{}"),this.cookieAttr)}}export{t as default}; //# sourceMappingURL=cookie-storage.js.map