Url.variables.deleteSearchParam
fx-fetch / Url / deleteSearchParam
Variable: deleteSearchParam()
Section titled “Variable: deleteSearchParam()”
constdeleteSearchParam: {(url,key,value?):Url; (key,value?): (url) =>Url; }
Defined in: packages/fx-fetch/src/Url/deleteSearchParam.ts:72
Deletes search parameters from a Url. If a value is provided, only that value is removed; otherwise, all values for the key are removed.
Call Signature
Section titled “Call Signature”(
url,key,value?):Url
Deletes search parameters from a Url. If a value is provided, only that value is removed; otherwise, all values for the key are removed.
Parameters
Section titled “Parameters”string
value?
Section titled “value?”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', 'sale'], },});
Url.format(url); // 'https://example.com?tag=new&tag=sale'
// Remove specific 'tag' parameterurl.pipe( Url.deleteSearchParam('tag', 'sale'), Url.format // 'https://example.com?tag=new');
// Remove all 'tag' parametersurl.pipe( Url.deleteSearchParam('tag'), Url.format // 'https://example.com');0.1.0
Call Signature
Section titled “Call Signature”(
key,value?): (url) =>Url
Deletes search parameters from a Url. If a value is provided, only that value is removed; otherwise, all values for the key are removed.
Parameters
Section titled “Parameters”string
value?
Section titled “value?”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', 'sale'], },});
Url.format(url); // 'https://example.com?tag=new&tag=sale'
// Remove specific 'tag' parameterurl.pipe( Url.deleteSearchParam('tag', 'sale'), Url.format // 'https://example.com?tag=new');
// Remove all 'tag' parametersurl.pipe( Url.deleteSearchParam('tag'), Url.format // 'https://example.com');0.1.0
Example
Section titled “Example”import { Url } from 'fx-fetch';
const url = Url.unsafeMake({ url: 'https://example.com', searchParams: { tag: ['new', 'sale'], },});
Url.format(url); // 'https://example.com?tag=new&tag=sale'
// Remove specific 'tag' parameterurl.pipe( Url.deleteSearchParam('tag', 'sale'), Url.format // 'https://example.com?tag=new');
// Remove all 'tag' parametersurl.pipe( Url.deleteSearchParam('tag'), Url.format // 'https://example.com');0.1.0