Url.variables.setSearchParam
fx-fetch / Url / setSearchParam
Variable: setSearchParam()
Section titled “Variable: setSearchParam()”
constsetSearchParam: {(url,key,value):Url; (key,value): (url) =>Url; }
Defined in: packages/fx-fetch/src/Url/setSearchParam.ts:45
Sets a search parameter on a Url. If the value is undefined, the parameter is removed.
Call Signature
Section titled “Call Signature”(
url,key,value):Url
Sets a search parameter on a Url. If the value is undefined, the parameter is removed.
Parameters
Section titled “Parameters”string
SearchParamValueInput
Returns
Section titled “Returns”Example
Section titled “Example”import { Url } from 'fx-fetch';
const url = Url.unsafeMake({ url: 'https://example.com', searchParams: { tag: "new" },}); // 'https://example.com?tag=new'
const updatedUrl = Url.setSearchParam(url, 'tag', 'active'); // 'https://example.com?tag=active'0.1.0
Call Signature
Section titled “Call Signature”(
key,value): (url) =>Url
Sets a search parameter on a Url. If the value is undefined, the parameter is removed.
Parameters
Section titled “Parameters”string
SearchParamValueInput
Returns
Section titled “Returns”(
url):Url
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Example
Section titled “Example”import { Url } from 'fx-fetch';
const url = Url.unsafeMake({ url: 'https://example.com', searchParams: { tag: "new" },}); // 'https://example.com?tag=new'
const updatedUrl = Url.setSearchParam(url, 'tag', 'active'); // 'https://example.com?tag=active'0.1.0
Example
Section titled “Example”import { Url } from 'fx-fetch';
const url = Url.unsafeMake({ url: 'https://example.com', searchParams: { tag: "new" },}); // 'https://example.com?tag=new'
const updatedUrl = Url.setSearchParam(url, 'tag', 'active'); // 'https://example.com?tag=active'0.1.0