feat: zap (#107)
This commit is contained in:
parent
407a6fb802
commit
249593d547
72 changed files with 2582 additions and 818 deletions
|
|
@ -6,5 +6,4 @@ export * from './useFetchProfile'
|
|||
export * from './useFetchRelayInfo'
|
||||
export * from './useFetchRelayInfos'
|
||||
export * from './useFetchRelayList'
|
||||
export * from './useSearchParams'
|
||||
export * from './useSearchProfiles'
|
||||
|
|
|
|||
|
|
@ -1,24 +0,0 @@
|
|||
export function useSearchParams() {
|
||||
const searchParams = new URLSearchParams(window.location.search)
|
||||
|
||||
return {
|
||||
searchParams,
|
||||
get: (key: string) => searchParams.get(key),
|
||||
set: (key: string, value: string) => {
|
||||
searchParams.set(key, value)
|
||||
window.history.replaceState(
|
||||
null,
|
||||
'',
|
||||
`${window.location.pathname}?${searchParams.toString()}`
|
||||
)
|
||||
},
|
||||
delete: (key: string) => {
|
||||
searchParams.delete(key)
|
||||
window.history.replaceState(
|
||||
null,
|
||||
'',
|
||||
`${window.location.pathname}?${searchParams.toString()}`
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue