(
f: (
upstream: Pull.Pull<InElem, InErr, InDone>,
scope: Scope.Scope,
forkedScope: Scope.Scope
) => Effect.Effect<Pull.Pull<OutElem, OutErr, OutDone, EnvX>, EX, Env>
)
| 386 | * pulls, but also provides a forked scope that closes when the resulting |
| 387 | * Channel completes. |
| 388 | * |
| 389 | * **When to use** |
| 390 | * |
| 391 | * Use when building channels that require scoped resource lifecycle management, |
| 392 | * providing both the channel scope and a forked scope that automatically closes |
| 393 | * when the channel completes. |
| 394 | * |
| 395 | * @see {@link fromTransform} for a simpler transformation without a forked scope |
| 396 | * @category constructors |
| 397 | * @since 4.0.0 |
| 398 | */ |
| 399 | export const fromTransformBracket = <OutElem, OutErr, OutDone, InElem, InErr, InDone, EX, EnvX, Env>( |
| 400 | f: ( |
| 401 | upstream: Pull.Pull<InElem, InErr, InDone>, |
| 402 | scope: Scope.Scope, |
| 403 | forkedScope: Scope.Scope |
| 404 | ) => Effect.Effect<Pull.Pull<OutElem, OutErr, OutDone, EnvX>, EX, Env> |
| 405 | ): Channel<OutElem, Pull.ExcludeDone<OutErr> | EX, OutDone, InElem, InErr, InDone, Env | EnvX> => |
| 406 | fromTransform( |
| 407 | Effect.fnUntraced(function*(upstream, scope) { |
| 408 | const closableScope = Scope.forkUnsafe(scope) |
| 409 | const onCause = (cause: Cause.Cause<EX | OutErr | Cause.Done<OutDone>>) => |
no test coverage detected
searching dependent graphs…