Skip to content

Instantly share code, notes, and snippets.

@PedroHLC
Created November 5, 2023 17:26
Show Gist options
  • Save PedroHLC/5591b2c1b0fd7e1cfc846a728ab2ae67 to your computer and use it in GitHub Desktop.
Save PedroHLC/5591b2c1b0fd7e1cfc846a728ab2ae67 to your computer and use it in GitHub Desktop.
(()=>{"use strict";var e={d:(o,t)=>{for(var r in t)e.o(t,r)&&!e.o(o,r)&&Object.defineProperty(o,r,{enumerable:!0,get:t[r]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};e.r(o),e.d(o,{install:()=>l}),TaskPort;const t=JSON.parse('{"u2":"elm-localstorage","i8":"1.0.1"}'),r=t.i8,s="lobanov/"+t.u2;function l(e){const o=e.createNamespace(s,r);o.register("localGet",(e=>window.localStorage.getItem(e))),o.register("localPut",(({key:e,value:o})=>window.localStorage.setItem(e,o))),o.register("localRemove",(e=>window.localStorage.removeItem(e))),o.register("localList",(()=>{const e=Array(window.localStorage.length);for(let o=0;o<e.length;o++)e[o]=window.localStorage.key(o);return e})),o.register("localClear",(()=>window.localStorage.clear())),o.register("sessionGet",(e=>window.sessionStorage.getItem(e))),o.register("sessionPut",(({key:e,value:o})=>window.sessionStorage.setItem(e,o))),o.register("sessionRemove",(e=>window.sessionStorage.removeItem(e))),o.register("sessionList",(()=>{const e=Array(window.sessionStorage.length);for(let o=0;o<e.length;o++)e[o]=window.sessionStorage.key(o);return e})),o.register("sessionClear",(()=>window.sessionStorage.clear()))}self.LocalStorage=o})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment