Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support repeated query parameters as an array #115

Open
gwax opened this issue Oct 2, 2024 · 3 comments
Open

Support repeated query parameters as an array #115

gwax opened this issue Oct 2, 2024 · 3 comments

Comments

@gwax
Copy link
Contributor

gwax commented Oct 2, 2024

Describe the problem

Use repeated query parameters for array serialization instead of encoding an array as a single parameter:

For example: query=1&query=2&query=3 instead of query=[1,2,3]

Describe the proposed solution

A StoreOption to the effect of append to indicate that modifying the searchParams should use "append" instead of "set" and should read via "getAll" instead of "get". An empty array serializes as an absence of keys and a non-empty array serializes using the encoder on each element and storing the value in repeated query parameters

@tcurdt
Copy link

tcurdt commented Oct 28, 2024

@paoloricciuti no promises, but would you willing to accept a PR for this?

@paoloricciuti
Copy link
Owner

@tcurdt oh absolutely (maybe just wait for the svelte 5 support release 😄

@tcurdt
Copy link

tcurdt commented Oct 29, 2024

just wait for the svelte 5 support release

I was thinking the same :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants