{
  "id": "@typed/fx#Fx.onExit",
  "canonicalId": "@typed/fx/Fx#onExit",
  "symbol": {
    "id": "@typed/fx#Fx.onExit",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "Fx.onExit",
    "kind": "constant",
    "signatures": [
      "export declare const onExit: {\n    <A, E, XE = never, XR = never>(f: (exit: Exit.Exit<void, E>) => void | Effect.Effect<void, XE, XR>): <R>(self: Fx<A, E, R>) => Fx<A, E | XE, R | XR>;\n    <A, E, R, XE = never, XR = never>(self: Fx<A, E, R>, f: (exit: Exit.Exit<void, E>) => void | Effect.Effect<void, XE, XR>): Fx<A, E | XE, R | XR>;\n};"
    ],
    "summary": "Observes the Fx's final success or failure with an Effect finalizer.",
    "sections": {
      "Why": "Teardown and audit work sometimes depends on how the complete subscription\nended. An `Exit` preserves that distinction without materializing it as a\nstream value.",
      "Ownership and lifetime": "The finalizer runs once after successful completion, a reported source cause,\nor interruption of the running fiber. The success Exit carries `void`\nbecause an Fx may emit many values and has no single terminal success value.\nA finalizer failure after normal completion is reported in the returned error\nchannel. After a source failure or interruption it is suppressed so the\nalready-observed termination remains authoritative. Finalizer services live\nfor the subscription only."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect, Exit } from \"effect\"\nimport { onExit } from \"@typed/fx/Fx\"\nimport { succeed } from \"@typed/fx/Fx\"\n\nconst audited = onExit(succeed(\"ready\"), (exit) =>\n  Effect.log(Exit.isSuccess(exit) ? \"complete\" : \"failed\")\n)"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/combinators/onExit.ts",
      "line": 51
    },
    "since": "1.0.0",
    "category": "Resource lifetime"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#Fx.onExit",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.13",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "Fx",
    "qualifiedName": "Fx.onExit",
    "declarationKey": "declaration:56d9ad529333240e88262019",
    "family": "variable",
    "signatures": [
      "export declare const onExit: {\n    <A, E, XE = never, XR = never>(f: (exit: Exit.Exit<void, E>) => void | Effect.Effect<void, XE, XR>): <R>(self: Fx<A, E, R>) => Fx<A, E | XE, R | XR>;\n    <A, E, R, XE = never, XR = never>(self: Fx<A, E, R>, f: (exit: Exit.Exit<void, E>) => void | Effect.Effect<void, XE, XR>): Fx<A, E | XE, R | XR>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/onExit.ts",
        "start": {
          "line": 51,
          "column": 14
        },
        "end": {
          "line": 108,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/onExit.ts",
        "start": {
          "line": 52,
          "column": 3
        },
        "end": {
          "line": 54,
          "column": 54
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/onExit.ts",
        "start": {
          "line": 56,
          "column": 3
        },
        "end": {
          "line": 59,
          "column": 28
        }
      }
    ],
    "aliases": [
      "@typed/fx/Fx#onExit"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#Fx",
    "static": false,
    "importedFrom": "declaration:56d9ad529333240e88262019"
  },
  "declaration": {
    "declarationKey": "declaration:56d9ad529333240e88262019",
    "name": "onExit",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const onExit: {\n    <A, E, XE = never, XR = never>(f: (exit: Exit.Exit<void, E>) => void | Effect.Effect<void, XE, XR>): <R>(self: Fx<A, E, R>) => Fx<A, E | XE, R | XR>;\n    <A, E, R, XE = never, XR = never>(self: Fx<A, E, R>, f: (exit: Exit.Exit<void, E>) => void | Effect.Effect<void, XE, XR>): Fx<A, E | XE, R | XR>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/onExit.ts",
            "start": {
              "line": 51,
              "column": 14
            },
            "end": {
              "line": 108,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<A, E, XE = never, XR = never>(f: (exit: Exit.Exit<void, E>) => void | Effect.Effect<void, XE, XR>): <R>(self: Fx<A, E, R>) => Fx<A, E | XE, R | XR>;",
          "<A, E, R, XE = never, XR = never>(self: Fx<A, E, R>, f: (exit: Exit.Exit<void, E>) => void | Effect.Effect<void, XE, XR>): Fx<A, E | XE, R | XR>;"
        ],
        "typeParameters": [
          "A",
          "E",
          "XE = never",
          "XR = never",
          "R"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/onExit.ts",
            "start": {
              "line": 52,
              "column": 3
            },
            "end": {
              "line": 54,
              "column": 54
            }
          },
          {
            "file": "packages/fx/src/Fx/combinators/onExit.ts",
            "start": {
              "line": 56,
              "column": 3
            },
            "end": {
              "line": 59,
              "column": 28
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const onExit: {\n    <A, E, XE = never, XR = never>(f: (exit: Exit.Exit<void, E>) => void | Effect.Effect<void, XE, XR>): <R>(self: Fx<A, E, R>) => Fx<A, E | XE, R | XR>;\n    <A, E, R, XE = never, XR = never>(self: Fx<A, E, R>, f: (exit: Exit.Exit<void, E>) => void | Effect.Effect<void, XE, XR>): Fx<A, E | XE, R | XR>;\n};"
    ],
    "typeParameters": [
      "A",
      "E",
      "XE = never",
      "XR = never",
      "R"
    ],
    "summary": "Observes the Fx's final success or failure with an Effect finalizer.",
    "sections": {
      "Why": "Teardown and audit work sometimes depends on how the complete subscription\nended. An `Exit` preserves that distinction without materializing it as a\nstream value.",
      "Ownership and lifetime": "The finalizer runs once after successful completion, a reported source cause,\nor interruption of the running fiber. The success Exit carries `void`\nbecause an Fx may emit many values and has no single terminal success value.\nA finalizer failure after normal completion is reported in the returned error\nchannel. After a source failure or interruption it is suppressed so the\nalready-observed termination remains authoritative. Finalizer services live\nfor the subscription only."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect, Exit } from \"effect\"\nimport { onExit } from \"@typed/fx/Fx\"\nimport { succeed } from \"@typed/fx/Fx\"\n\nconst audited = onExit(succeed(\"ready\"), (exit) =>\n  Effect.log(Exit.isSuccess(exit) ? \"complete\" : \"failed\")\n)"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/onExit.ts",
        "start": {
          "line": 51,
          "column": 14
        },
        "end": {
          "line": 108,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/onExit.ts",
        "start": {
          "line": 52,
          "column": 3
        },
        "end": {
          "line": 54,
          "column": 54
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/onExit.ts",
        "start": {
          "line": 56,
          "column": 3
        },
        "end": {
          "line": 59,
          "column": 28
        }
      }
    ],
    "since": "1.0.0",
    "category": "Resource lifetime"
  }
}
