Skip to content

Url.variables.setSearchParam

fx-fetch


fx-fetch / Url / setSearchParam

const setSearchParam: {(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.

(url, key, value): Url

Sets a search parameter on a Url. If the value is undefined, the parameter is removed.

Url

string

SearchParamValueInput

Url

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

(key, value): (url) => Url

Sets a search parameter on a Url. If the value is undefined, the parameter is removed.

string

SearchParamValueInput

(url): Url

Url

Url

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

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