MCPcopy Create free account
hub / github.com/Effect-TS/effect / toStream

Function toStream

packages/effect/src/http-api/HttpApiClient.ts:1416–1421  ·  view source on GitHub ↗
(response, sseOptions)

Source from the content-addressed store, hash-verified

1414 const streamSchema = isWithHeaders ? successSchema.schema : successSchema
1415 const decodeBody = makeStreamBodyDecoder(streamSchema, options)
1416 const toStream: ResponseDecoder = (response, sseOptions) =>
1417 Effect.map(Effect.context<never>(), (context) =>
1418 Stream.provideContext(
1419 decodeBody(response, sseOptions),
1420 context as Context.Context<unknown>
1421 ))
1422 if (!isWithHeaders) return toStream
1423
1424 const decodeHeaders = Schema.decodeUnknownEffect(successSchema.headers, headersOptions)

Callers 1

streamToResponseFunction · 0.70

Calls 2

contextMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected