(options: {
readonly url: string
readonly transformClient?: <E, R>(client: HttpClient.HttpClient.With<E, R>) => HttpClient.HttpClient.With<E, R>
readonly batch?: {
readonly window: Duration.Input
readonly maxSize?: number | undefined
} | undefined
})
| 1264 | * @since 4.0.0 |
| 1265 | */ |
| 1266 | export const layerProtocolHttp = (options: { |
| 1267 | readonly url: string |
| 1268 | readonly transformClient?: <E, R>(client: HttpClient.HttpClient.With<E, R>) => HttpClient.HttpClient.With<E, R> |
| 1269 | readonly batch?: { |
| 1270 | readonly window: Duration.Input |
| 1271 | readonly maxSize?: number | undefined |
| 1272 | } | undefined |
| 1273 | }): Layer.Layer<Protocol, never, RpcSerialization.RpcSerialization | HttpClient.HttpClient> => |
| 1274 | Layer.effect(Protocol)( |
| 1275 | Effect.flatMap( |
| 1276 | HttpClient.HttpClient, |
| 1277 | (client) => { |
| 1278 | client = HttpClient.mapRequest(client, HttpClientRequest.prependUrl(options.url)) |
| 1279 | return makeProtocolHttp(options.transformClient ? options.transformClient(client) : client, { |
| 1280 | batch: options.batch |
| 1281 | }) |
| 1282 | } |
| 1283 | ) |
| 1284 | ) |
| 1285 | |
| 1286 | /** |
| 1287 | * Creates a client `Protocol` over the current `Socket`, using the current |
nothing calls this directly
no test coverage detected