Re: [whatwg/url] URLSearchParams delete all vs delete one (#335)

Just ran into this myself. I guessed that `params.delete(key, valueMatch)` would work but didn't, then came searching.

Use case is a typical sidebar product search filters. If you've got links to multiple brands of shoes maybe you'd like to click the brand to append it to the search params, and if it's already there, remove it.

Of course you can make an array, manipulate it, and construct a new one, but `append` sure is nicer than that. Deleting by key/value would be a nice bookend to `append`.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/issues/335#issuecomment-919700370

Received on Wednesday, 15 September 2021 05:01:04 UTC