MCPcopy Create free account
hub / github.com/TanStack/query / getSearchParams

Function getSearchParams

examples/solid/astro/src/utils/index.ts:3–13  ·  view source on GitHub ↗
(init: string)

Source from the content-addressed store, hash-verified

1import { createSignal } from 'solid-js'
2
3export const getSearchParams = (init: string) => {
4 const [search, setSearch] = createSignal(init)
5 if (typeof window !== 'undefined') {
6 window.addEventListener('popstate', () => {
7 const location = window.location
8 const params = new URLSearchParams(location.search)
9 setSearch(params.get('id') || '')
10 })
11 }
12 return search
13}
14
15export const properCase = (str: string) =>
16 str.charAt(0).toUpperCase() + str.slice(1)

Callers 1

SolidAppFunction · 0.90

Calls 1

getMethod · 0.80

Tested by

no test coverage detected