You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be very needed that setSearchParams from solid-start works like setting state, meaning it holds previous value and overwrites existing state when omitting prev. That way, it both works when you want to overwrite existing or append.
Hey @rattleSSnake
I share the logic here but I don't think the breaking change is a good idea.
Noneless I'd be happy to make the change and refactor mergeSearchString if the reviewer asks me to do so.
Just to add in to this - I'm looking to support Browsers before Proxy support is added. I'd prefer for it also to be a plain Object. If there is any way to do this without proxy (maybe defining which search or query params one was looking for). I'll be diving into Router code this week probably forking it to remove that for now as I don't need reactive params.
Just to add in to this - I'm looking to support Browsers before Proxy support is added. I'd prefer for it also to be a plain Object. If there is any way to do this without proxy (maybe defining which search or query params one was looking for). I'll be diving into Router code this week probably forking it to remove that for now as I don't need reactive params.
It's tricky from a general sense because params can change shape, ie be added removed. My gut is I can't just get rid of the proxy here.
I'm looking at this now. I think for params you could process all the routes and look for all the defined params and create an object with get / set for each of the possible params from the routes.
For Query params you'd need to be told all the possible query params. I think it's doable to avoid the proxy.
Activity
xrtis commentedon May 28, 2023
Undefined for delete ?
[-]`setSearchParams` suggestion[/-][+]`useSearchParams` suggestion[/+]xrtis commentedon May 28, 2023
i think proxy is needed for reactivity
the current
useSearchParamsfunction could be updateddidn t try tbh
https://github.com/solidjs/solid-router/blob/HEAD/src/routing.ts#L100-L115
xrtis commentedon May 28, 2023
you might be able to use
producehttps://www.solidjs.com/docs/latest/api#produceagain, i didn t try
would be a breaking change
xrtis commentedon May 28, 2023
I don't really like the delete keyword in general so this doesn't bother me but that's a personal preference and I'm not a core member ;)
I think Ryan spoke about this pattern for
storein one of his streams. I'll add the link if I find it.xrtis commentedon May 31, 2023
Hey @rattleSSnake
I share the logic here but I don't think the breaking change is a good idea.
Noneless I'd be happy to make the change and refactor
mergeSearchStringif the reviewer asks me to do so.xrtis commentedon May 31, 2023
This will reset search params
chiefcll commentedon Sep 8, 2024
Just to add in to this - I'm looking to support Browsers before Proxy support is added. I'd prefer for it also to be a plain Object. If there is any way to do this without proxy (maybe defining which search or query params one was looking for). I'll be diving into Router code this week probably forking it to remove that for now as I don't need reactive params.
ryansolid commentedon Sep 9, 2024
It's tricky from a general sense because params can change shape, ie be added removed. My gut is I can't just get rid of the proxy here.
chiefcll commentedon Sep 14, 2024
I'm looking at this now. I think for params you could process all the routes and look for all the defined params and create an object with get / set for each of the possible params from the routes.
For Query params you'd need to be told all the possible query params. I think it's doable to avoid the proxy.