| 1636 | * await Effect.runPromise(program) |
| 1637 | * ``` |
| 1638 | * |
| 1639 | * @category constructors |
| 1640 | * @since 2.0.0 |
| 1641 | */ |
| 1642 | export const unwrap = <A, E2, R2, E, R>( |
| 1643 | effect: Effect.Effect<Stream<A, E2, R2>, E, R> |
| 1644 | ): Stream<A, E | E2, R2 | Exclude<R, Scope.Scope>> => fromChannel(Channel.unwrap(Effect.map(effect, toChannel))) |
| 1645 | |
| 1646 | /** |
| 1647 | * Runs a stream that requires `Scope` in a managed scope, ensuring its |
| 1648 | * finalizers are run when the stream completes. |
| 1649 | * |
| 1650 | * **Example** (Scoping a stream) |
| 1651 | * |
| 1652 | * ```ts import.meta.vitest |