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