{
  "id": "@typed/fx/Fx#unwrapScoped",
  "canonicalId": "@typed/fx/Fx#unwrapScoped",
  "symbol": {
    "id": "@typed/fx/Fx#unwrapScoped",
    "packageName": "@typed/fx",
    "moduleName": "Fx",
    "exportName": "unwrapScoped",
    "kind": "constant",
    "signatures": [
      "export declare const unwrapScoped: <A, E, R, E2, R2>(effect: Effect.Effect<Fx<A, E, R>, E2, R2 | Scope.Scope>) => Fx<A, E | E2, Exclude<R | R2, Scope.Scope>>;"
    ],
    "summary": "Unwraps an Effect that produces an Fx into a single Fx, managing the scope of the effect.\n\nThe scope of the effect is closed when the Fx completes or is interrupted.",
    "sections": {
      "Why": "`unwrapScoped` is the safe boundary for an Effect that acquires resources\nwhile choosing an Fx. It discharges the inner `Scope` requirement instead of\nleaking acquisition lifetime to every consumer.",
      "Execution and cardinality": "Each observation opens one Scope, runs `effect` once, then forwards every\nvalue from the produced Fx in order. The inner never starts if acquisition\nfails, and the acquisition Effect adds no output value.",
      "Ownership and lifetime": "Acquisition and inner failures are forwarded. Non-Scope services from both\nphases remain required. The opened Scope owns resources acquired by both the\nEffect and produced Fx; it closes after normal completion, failure, or\ninterruption, running finalizers exactly at the observation boundary."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Fx } from \"@typed/fx\"\nimport { Effect } from \"effect\"\n\nconst scoped = Fx.unwrapScoped(\n  Effect.acquireRelease(\n    Effect.succeed(Fx.succeed(\"connected\")),\n    () => Effect.void\n  )\n)"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/combinators/unwrapScoped.ts",
      "line": 49
    },
    "since": "1.0.0",
    "category": "Generator composition"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx/Fx#unwrapScoped",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.7",
    "moduleName": "Fx",
    "consumerSpecifier": "@typed/fx/Fx",
    "exportName": "unwrapScoped",
    "qualifiedName": "unwrapScoped",
    "declarationKey": "declaration:7c28c8e21d9185c9cc3c0fd6",
    "family": "variable",
    "signatures": [
      "export declare const unwrapScoped: <A, E, R, E2, R2>(effect: Effect.Effect<Fx<A, E, R>, E2, R2 | Scope.Scope>) => Fx<A, E | E2, Exclude<R | R2, Scope.Scope>>;"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/unwrapScoped.ts",
        "start": {
          "line": 49,
          "column": 14
        },
        "end": {
          "line": 59,
          "column": 4
        }
      }
    ],
    "aliases": [
      "@typed/fx#Fx.unwrapScoped"
    ],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:7c28c8e21d9185c9cc3c0fd6",
    "name": "unwrapScoped",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const unwrapScoped: <A, E, R, E2, R2>(effect: Effect.Effect<Fx<A, E, R>, E2, R2 | Scope.Scope>) => Fx<A, E | E2, Exclude<R | R2, Scope.Scope>>;"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/unwrapScoped.ts",
            "start": {
              "line": 49,
              "column": 14
            },
            "end": {
              "line": 59,
              "column": 4
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const unwrapScoped: <A, E, R, E2, R2>(effect: Effect.Effect<Fx<A, E, R>, E2, R2 | Scope.Scope>) => Fx<A, E | E2, Exclude<R | R2, Scope.Scope>>;"
    ],
    "typeParameters": [],
    "summary": "Unwraps an Effect that produces an Fx into a single Fx, managing the scope of the effect.\n\nThe scope of the effect is closed when the Fx completes or is interrupted.",
    "sections": {
      "Why": "`unwrapScoped` is the safe boundary for an Effect that acquires resources\nwhile choosing an Fx. It discharges the inner `Scope` requirement instead of\nleaking acquisition lifetime to every consumer.",
      "Execution and cardinality": "Each observation opens one Scope, runs `effect` once, then forwards every\nvalue from the produced Fx in order. The inner never starts if acquisition\nfails, and the acquisition Effect adds no output value.",
      "Ownership and lifetime": "Acquisition and inner failures are forwarded. Non-Scope services from both\nphases remain required. The opened Scope owns resources acquired by both the\nEffect and produced Fx; it closes after normal completion, failure, or\ninterruption, running finalizers exactly at the observation boundary."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Fx } from \"@typed/fx\"\nimport { Effect } from \"effect\"\n\nconst scoped = Fx.unwrapScoped(\n  Effect.acquireRelease(\n    Effect.succeed(Fx.succeed(\"connected\")),\n    () => Effect.void\n  )\n)"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/unwrapScoped.ts",
        "start": {
          "line": 49,
          "column": 14
        },
        "end": {
          "line": 59,
          "column": 4
        }
      }
    ],
    "since": "1.0.0",
    "category": "Generator composition"
  }
}
