Add Option to Prevent URL Updates on Initial Render#143
### Describe the problem Hey, thanks for the great library! It’s super handy for working with query parameters in SvelteKit. I noticed that when you set a defaultValue, it updates the URL on the initial render if the parameter isn’t already there. For example: ```svelte const count = queryParam('count', { encode: (value: number) => value.toString(), decode: (value: string | null) => (value ? parseInt(value) : null), defaultValue: 10, }); ``` If I load `/`, it immediately changes the URL to `/?count=10`. It would be nice to have an option to apply the default value without modifying the URL right away. ### Describe the proposed solution Maybe something like: ``` const count = queryParam('count', { encode: (value: number) => value.toString(), decode: (value: string | null) => (value ? parseInt(value) : null), defaultValue: 10, applyDefaultValueSilently: true, }); ``` This way, count would still default to 10 internally, but the URL stays clean until the user interacts with it. Let me know if this makes sense or if there’s already a way to do this. Thanks again for your hard work on this library!
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be still under discussion. The issue was opened by fromaline and has received 7 comments.