@accounter/client
Version:
Accounter client application
1 lines • 506 B
JavaScript
import{Cd as e,Id as t,jd as n}from"./index-CSYTUOOk.js";var r=t(n(),1);function i(){let{search:t}=e(),n=(0,r.useMemo)(()=>new URLSearchParams(t),[t]),i=(0,r.useCallback)(()=>{if(window.history.pushState){let e=n.keys().next().done?``:`?${n.toString()}`,t=window.location.protocol+`//`+window.location.host+window.location.pathname+e;window.history.pushState({path:t},``,t)}},[n]);return{query:n,queryString:()=>n.toString(),get:e=>n?.get(e),set:(e,t)=>{t==null?n.delete(e):n.set(e,t),i()}}}export{i as t};