{
  "id": "@typed/fx/Versioned#map",
  "canonicalId": "@typed/fx/Versioned#map",
  "symbol": {
    "id": "@typed/fx/Versioned#map",
    "packageName": "@typed/fx",
    "moduleName": "Versioned",
    "exportName": "map",
    "kind": "constant",
    "signatures": [
      "export declare const map: {\n    <A, E, R, C, B, D>(options: {\n        onFx: (a: A) => C;\n        onEffect: (b: B) => D;\n    }): <R0, E0, R2, E2>(versioned: Versioned<R0, E0, A, E, R, B, E2, R2>) => Versioned<never, never, C, E, R, D, E0 | E2, R0 | R2>;\n    <R0, E0, A, E, R, B, E2, R2, C, D>(versioned: Versioned<R0, E0, A, E, R, B, E2, R2>, options: {\n        onFx: (a: A) => C;\n        onEffect: (b: B) => D;\n    }): Versioned<never, never, C, E, R, D, E0 | E2, R0 | R2>;\n};"
    ],
    "summary": "Transform a Versioned's output value as both an Fx and Effect.",
    "sections": {
      "Why": "Applies corresponding pure projections to pushed and sampled values while leaving the version\ntoken unchanged.",
      "Ownership and lifetime": "map does not take ownership of its inputs. Its observation and current-read channels retain\nupstream lifetime, typed failures, services, and interruption behavior.\n\nPure callbacks preserve push order and cardinality. `onFx` applies to every pushed update;\n`onEffect` applies only when the current value is sampled."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport * as Versioned from \"@typed/fx/Versioned\"\n\nconst length = Versioned.map(Versioned.of(\"typed\"), {\n  onFx: (value) => value.length,\n  onEffect: (value) => value.length\n})\n\nconst currentLength = Effect.runPromise(length)"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Versioned/Versioned.ts",
      "line": 538
    },
    "since": "1.18.0",
    "category": "Channel transformations"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx/Versioned#map",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.13",
    "moduleName": "Versioned",
    "consumerSpecifier": "@typed/fx/Versioned",
    "exportName": "map",
    "qualifiedName": "map",
    "declarationKey": "declaration:687dbc21a48875e73862e069",
    "family": "variable",
    "signatures": [
      "export declare const map: {\n    <A, E, R, C, B, D>(options: {\n        onFx: (a: A) => C;\n        onEffect: (b: B) => D;\n    }): <R0, E0, R2, E2>(versioned: Versioned<R0, E0, A, E, R, B, E2, R2>) => Versioned<never, never, C, E, R, D, E0 | E2, R0 | R2>;\n    <R0, E0, A, E, R, B, E2, R2, C, D>(versioned: Versioned<R0, E0, A, E, R, B, E2, R2>, options: {\n        onFx: (a: A) => C;\n        onEffect: (b: B) => D;\n    }): Versioned<never, never, C, E, R, D, E0 | E2, R0 | R2>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Versioned/Versioned.ts",
        "start": {
          "line": 538,
          "column": 14
        },
        "end": {
          "line": 564,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Versioned/Versioned.ts",
        "start": {
          "line": 539,
          "column": 3
        },
        "end": {
          "line": 544,
          "column": 62
        }
      },
      {
        "file": "packages/fx/src/Versioned/Versioned.ts",
        "start": {
          "line": 546,
          "column": 3
        },
        "end": {
          "line": 552,
          "column": 60
        }
      }
    ],
    "aliases": [
      "@typed/fx#Versioned.map"
    ],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:687dbc21a48875e73862e069",
    "name": "map",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const map: {\n    <A, E, R, C, B, D>(options: {\n        onFx: (a: A) => C;\n        onEffect: (b: B) => D;\n    }): <R0, E0, R2, E2>(versioned: Versioned<R0, E0, A, E, R, B, E2, R2>) => Versioned<never, never, C, E, R, D, E0 | E2, R0 | R2>;\n    <R0, E0, A, E, R, B, E2, R2, C, D>(versioned: Versioned<R0, E0, A, E, R, B, E2, R2>, options: {\n        onFx: (a: A) => C;\n        onEffect: (b: B) => D;\n    }): Versioned<never, never, C, E, R, D, E0 | E2, R0 | R2>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Versioned/Versioned.ts",
            "start": {
              "line": 538,
              "column": 14
            },
            "end": {
              "line": 564,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<A, E, R, C, B, D>(options: {\n    onFx: (a: A) => C;\n    onEffect: (b: B) => D;\n}): <R0, E0, R2, E2>(versioned: Versioned<R0, E0, A, E, R, B, E2, R2>) => Versioned<never, never, C, E, R, D, E0 | E2, R0 | R2>;",
          "<R0, E0, A, E, R, B, E2, R2, C, D>(versioned: Versioned<R0, E0, A, E, R, B, E2, R2>, options: {\n    onFx: (a: A) => C;\n    onEffect: (b: B) => D;\n}): Versioned<never, never, C, E, R, D, E0 | E2, R0 | R2>;"
        ],
        "typeParameters": [
          "A",
          "E",
          "R",
          "C",
          "B",
          "D",
          "R0",
          "E0",
          "E2",
          "R2"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Versioned/Versioned.ts",
            "start": {
              "line": 539,
              "column": 3
            },
            "end": {
              "line": 544,
              "column": 62
            }
          },
          {
            "file": "packages/fx/src/Versioned/Versioned.ts",
            "start": {
              "line": 546,
              "column": 3
            },
            "end": {
              "line": 552,
              "column": 60
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const map: {\n    <A, E, R, C, B, D>(options: {\n        onFx: (a: A) => C;\n        onEffect: (b: B) => D;\n    }): <R0, E0, R2, E2>(versioned: Versioned<R0, E0, A, E, R, B, E2, R2>) => Versioned<never, never, C, E, R, D, E0 | E2, R0 | R2>;\n    <R0, E0, A, E, R, B, E2, R2, C, D>(versioned: Versioned<R0, E0, A, E, R, B, E2, R2>, options: {\n        onFx: (a: A) => C;\n        onEffect: (b: B) => D;\n    }): Versioned<never, never, C, E, R, D, E0 | E2, R0 | R2>;\n};"
    ],
    "typeParameters": [
      "A",
      "E",
      "R",
      "C",
      "B",
      "D",
      "R0",
      "E0",
      "E2",
      "R2"
    ],
    "summary": "Transform a Versioned's output value as both an Fx and Effect.",
    "sections": {
      "Why": "Applies corresponding pure projections to pushed and sampled values while leaving the version\ntoken unchanged.",
      "Ownership and lifetime": "map does not take ownership of its inputs. Its observation and current-read channels retain\nupstream lifetime, typed failures, services, and interruption behavior.\n\nPure callbacks preserve push order and cardinality. `onFx` applies to every pushed update;\n`onEffect` applies only when the current value is sampled."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport * as Versioned from \"@typed/fx/Versioned\"\n\nconst length = Versioned.map(Versioned.of(\"typed\"), {\n  onFx: (value) => value.length,\n  onEffect: (value) => value.length\n})\n\nconst currentLength = Effect.runPromise(length)"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Versioned/Versioned.ts",
        "start": {
          "line": 538,
          "column": 14
        },
        "end": {
          "line": 564,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Versioned/Versioned.ts",
        "start": {
          "line": 539,
          "column": 3
        },
        "end": {
          "line": 544,
          "column": 62
        }
      },
      {
        "file": "packages/fx/src/Versioned/Versioned.ts",
        "start": {
          "line": 546,
          "column": 3
        },
        "end": {
          "line": 552,
          "column": 60
        }
      }
    ],
    "since": "1.18.0",
    "category": "Channel transformations"
  }
}
