Request.variables.mapUrl
Variable: mapUrl()
Section titled “Variable: mapUrl()”
constmapUrl: {(self,fn):Request; (fn): (self) =>Request; }
Defined in: packages/fx-fetch/src/Request/mapUrl.ts:35
Maps over the URL of a Request.
Call Signature
Section titled “Call Signature”(
self,fn):Request
Maps over the URL of a Request.
Parameters
Section titled “Parameters”(url) => Url
Returns
Section titled “Returns”Example
Section titled “Example”import { Request } from 'fx-fetch';import { Url } from 'fx-fetch';
const request = Request.make({ url: 'https://api.example.com' });const mappedRequest = Request.mapUrl(request, (url) => Url.appendPath(url, '/users'));0.1.0
Call Signature
Section titled “Call Signature”(
fn): (self) =>Request
Maps over the URL of a Request.
Parameters
Section titled “Parameters”(url) => Url
Returns
Section titled “Returns”(
self):Request
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Example
Section titled “Example”import { Request } from 'fx-fetch';import { Url } from 'fx-fetch';import { pipe } from 'effect';
const request = Request.make({ url: 'https://api.example.com' });
const mappedRequest = pipe( request, Request.mapUrl((url) => Url.appendPath(url, '/users')));0.1.0
Example
Section titled “Example”import { Request } from 'fx-fetch';import { Url } from 'fx-fetch';
const request = Request.make({ url: 'https://api.example.com' });const mappedRequest = Request.mapUrl(request, (url) => Url.appendPath(url, '/users'));0.1.0