MCPcopy Create free account
hub / github.com/effect-app/libs / fromTransform

Function fromTransform

repos/effect/packages/effect/src/Channel.ts:278–296  ·  view source on GitHub ↗
(
  transform: (
    upstream: Pull.Pull<InElem, InErr, InDone>,
    scope: Scope.Scope
  ) => Effect.Effect<Pull.Pull<OutElem, OutErr, OutDone, EnvX>, EX, Env>
)

Source from the content-addressed store, hash-verified

276 * )
277 * await Effect.runPromise(Channel.runCollect(channel)) // => []
278 * ```
279 *
280 * @category constructors
281 * @since 4.0.0
282 */
283export const fromTransform = <OutElem, OutErr, OutDone, InElem, InErr, InDone, EX, EnvX, Env>(
284 transform: (
285 upstream: Pull.Pull<InElem, InErr, InDone>,
286 scope: Scope.Scope
287 ) => Effect.Effect<Pull.Pull<OutElem, OutErr, OutDone, EnvX>, EX, Env>
288): Channel<
289 OutElem,
290 Pull.ExcludeDone<OutErr> | EX,
291 OutDone,
292 InElem,
293 InErr,
294 InDone,
295 Env | EnvX
296> => {
297 const self = Object.create(ChannelProto)
298 self.transform = (upstream: any, scope: Scope.Scope) =>
299 Effect.catchCause(transform(upstream, scope), (cause) => Effect.succeed(Effect.failCause(cause)))

Callers 11

transformPullFunction · 0.70
fromPullFunction · 0.70
fromTransformBracketFunction · 0.70
callbackFunction · 0.70
callbackArrayFunction · 0.70
suspendFunction · 0.70
identityFunction · 0.70
fromAsyncIterableFunction · 0.70
mapEffectSequentialFunction · 0.70
Channel.tsFile · 0.70
flatMapSequentialFunction · 0.70

Calls 2

transformFunction · 0.70
succeedMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…