- From: Tim Ruffles <notifications@github.com>
- Date: Fri, 12 Aug 2016 06:53:52 -0700
- To: whatwg/url <url@noreply.github.com>
Received on Friday, 12 August 2016 13:54:31 UTC
It'd be great to have a simple static method to go from key-value data to a formatted string in a single step:
```
// the idiomatic way to express kv data in JS
type dict = { [key: string]: string };
class URLSearchParams {
static toQueryString(params: URLSearchParams | dict): string;
}
```
This'd allow for idiomatic composition with other core JS APIs, matching the pleasant developer experience that people expect:
```
// creating
const queries = [{ k1: "v1"}, { k1: "v2" }]
const results = queries
.map(URLSearchParams.toQueryString)
.map(qs => fetch(someUrl + "?" + qs))
```
--
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/142
Received on Friday, 12 August 2016 13:54:31 UTC