{
  "id": "@typed/fx/Sink#tapEffect",
  "canonicalId": "@typed/fx/Sink#tapEffect",
  "symbol": {
    "id": "@typed/fx/Sink#tapEffect",
    "packageName": "@typed/fx",
    "moduleName": "Sink",
    "exportName": "tapEffect",
    "kind": "constant",
    "signatures": [
      "export declare const tapEffect: {\n    <A, E2, R2>(f: (a: A) => Effect.Effect<unknown, E2, R2>): <E, R>(sink: Sink<A, E | E2, R>) => Sink<A, E | E2, R | R2>;\n    <A, E, R, E2, R2>(sink: Sink<A, E | E2, R>, f: (a: A) => Effect.Effect<unknown, E2, R2>): Sink<A, E | E2, R | R2>;\n};"
    ],
    "summary": "Runs an effectful observation before forwarding each successful input unchanged.",
    "sections": {
      "Why": "Logging, metrics, and other observations can be attached at the consumer boundary without\nchanging the value type.",
      "Ownership and lifetime": "The tap Effect completes before the value is forwarded. If it fails, its Cause is delivered and\nthe value is not forwarded. The producer controls call order and concurrency; tap services and\ninterruption are reflected by the returned sink."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport * as Sink from \"@typed/fx/Sink\"\nconst observed = Sink.tapEffect(Sink.make(Effect.logError, Effect.log), (n: number) => Effect.log(`saw ${n}`))"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Sink/combinators.ts",
      "line": 1453
    },
    "since": "1.0.0",
    "category": "Transforming inputs"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx/Sink#tapEffect",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.7",
    "moduleName": "Sink",
    "consumerSpecifier": "@typed/fx/Sink",
    "exportName": "tapEffect",
    "qualifiedName": "tapEffect",
    "declarationKey": "declaration:06e1896b464c6d11422ecf60",
    "family": "variable",
    "signatures": [
      "export declare const tapEffect: {\n    <A, E2, R2>(f: (a: A) => Effect.Effect<unknown, E2, R2>): <E, R>(sink: Sink<A, E | E2, R>) => Sink<A, E | E2, R | R2>;\n    <A, E, R, E2, R2>(sink: Sink<A, E | E2, R>, f: (a: A) => Effect.Effect<unknown, E2, R2>): Sink<A, E | E2, R | R2>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Sink/combinators.ts",
        "start": {
          "line": 1453,
          "column": 14
        },
        "end": {
          "line": 1469,
          "column": 3
        }
      },
      {
        "file": "packages/fx/src/Sink/combinators.ts",
        "start": {
          "line": 1454,
          "column": 3
        },
        "end": {
          "line": 1456,
          "column": 66
        }
      },
      {
        "file": "packages/fx/src/Sink/combinators.ts",
        "start": {
          "line": 1457,
          "column": 3
        },
        "end": {
          "line": 1460,
          "column": 30
        }
      }
    ],
    "aliases": [
      "@typed/fx#Sink.tapEffect"
    ],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:06e1896b464c6d11422ecf60",
    "name": "tapEffect",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const tapEffect: {\n    <A, E2, R2>(f: (a: A) => Effect.Effect<unknown, E2, R2>): <E, R>(sink: Sink<A, E | E2, R>) => Sink<A, E | E2, R | R2>;\n    <A, E, R, E2, R2>(sink: Sink<A, E | E2, R>, f: (a: A) => Effect.Effect<unknown, E2, R2>): Sink<A, E | E2, R | R2>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Sink/combinators.ts",
            "start": {
              "line": 1453,
              "column": 14
            },
            "end": {
              "line": 1469,
              "column": 3
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<A, E2, R2>(f: (a: A) => Effect.Effect<unknown, E2, R2>): <E, R>(sink: Sink<A, E | E2, R>) => Sink<A, E | E2, R | R2>;",
          "<A, E, R, E2, R2>(sink: Sink<A, E | E2, R>, f: (a: A) => Effect.Effect<unknown, E2, R2>): Sink<A, E | E2, R | R2>;"
        ],
        "typeParameters": [
          "A",
          "E2",
          "R2",
          "E",
          "R"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Sink/combinators.ts",
            "start": {
              "line": 1454,
              "column": 3
            },
            "end": {
              "line": 1456,
              "column": 66
            }
          },
          {
            "file": "packages/fx/src/Sink/combinators.ts",
            "start": {
              "line": 1457,
              "column": 3
            },
            "end": {
              "line": 1460,
              "column": 30
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const tapEffect: {\n    <A, E2, R2>(f: (a: A) => Effect.Effect<unknown, E2, R2>): <E, R>(sink: Sink<A, E | E2, R>) => Sink<A, E | E2, R | R2>;\n    <A, E, R, E2, R2>(sink: Sink<A, E | E2, R>, f: (a: A) => Effect.Effect<unknown, E2, R2>): Sink<A, E | E2, R | R2>;\n};"
    ],
    "typeParameters": [
      "A",
      "E2",
      "R2",
      "E",
      "R"
    ],
    "summary": "Runs an effectful observation before forwarding each successful input unchanged.",
    "sections": {
      "Why": "Logging, metrics, and other observations can be attached at the consumer boundary without\nchanging the value type.",
      "Ownership and lifetime": "The tap Effect completes before the value is forwarded. If it fails, its Cause is delivered and\nthe value is not forwarded. The producer controls call order and concurrency; tap services and\ninterruption are reflected by the returned sink."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport * as Sink from \"@typed/fx/Sink\"\nconst observed = Sink.tapEffect(Sink.make(Effect.logError, Effect.log), (n: number) => Effect.log(`saw ${n}`))"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Sink/combinators.ts",
        "start": {
          "line": 1453,
          "column": 14
        },
        "end": {
          "line": 1469,
          "column": 3
        }
      },
      {
        "file": "packages/fx/src/Sink/combinators.ts",
        "start": {
          "line": 1454,
          "column": 3
        },
        "end": {
          "line": 1456,
          "column": 66
        }
      },
      {
        "file": "packages/fx/src/Sink/combinators.ts",
        "start": {
          "line": 1457,
          "column": 3
        },
        "end": {
          "line": 1460,
          "column": 30
        }
      }
    ],
    "since": "1.0.0",
    "category": "Transforming inputs"
  }
}
