{
  "id": "@typed/fx/RefSubject#transform",
  "canonicalId": "@typed/fx/RefSubject#transform",
  "symbol": {
    "id": "@typed/fx/RefSubject#transform",
    "packageName": "@typed/fx",
    "moduleName": "RefSubject",
    "exportName": "transform",
    "kind": "constant",
    "signatures": [
      "export declare const transform: {\n    <A, B>(toB: (a: A) => B, toA: (b: B) => A): <E, R>(ref: RefSubject<A, E, R>) => RefSubject<B, E, R>;\n    <A, E, R, B>(ref: RefSubject<A, E, R>, toB: (a: A) => B, toA: (b: B) => A): RefSubject<B, E, R>;\n};"
    ],
    "summary": "Transforms a `RefSubject` invariantly using bidirectional mapping functions.",
    "sections": {
      "Why": "Creates a bidirectional lens over state: reads map outward and writes map back to the original\nRefSubject without allocating a second store.",
      "Ownership and lifetime": "The derived ref owns no independent state or subscription. It follows the source lifetime and\nroutes writes through the source's synchronized update boundary."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport * as RefSubject from \"@typed/fx/RefSubject\"\n\nconst program = Effect.gen(function* () {\n  const count = yield* RefSubject.make(5)\n\n  // Transform to string and back\n  const countStr = RefSubject.transform(\n    count,\n    (n) => n.toString(),\n    (s) => parseInt(s, 10)\n  )\n\n  const value = yield* countStr\n  console.log(value) // \"5\"\n\n  // Set using the transformed type\n  yield* RefSubject.set(countStr, \"10\")\n\n  // Original reflects the change\n  const original = yield* count\n  console.log(original) // 10\n})"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/RefSubject/RefSubject.ts",
      "line": 3559
    },
    "since": "1.0.0",
    "category": "Writable views"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx/RefSubject#transform",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.7",
    "moduleName": "RefSubject",
    "consumerSpecifier": "@typed/fx/RefSubject",
    "exportName": "transform",
    "qualifiedName": "transform",
    "declarationKey": "declaration:1df58e2ae708e2eea3cc8510",
    "family": "variable",
    "signatures": [
      "export declare const transform: {\n    <A, B>(toB: (a: A) => B, toA: (b: B) => A): <E, R>(ref: RefSubject<A, E, R>) => RefSubject<B, E, R>;\n    <A, E, R, B>(ref: RefSubject<A, E, R>, toB: (a: A) => B, toA: (b: B) => A): RefSubject<B, E, R>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3559,
          "column": 14
        },
        "end": {
          "line": 3572,
          "column": 3
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3560,
          "column": 3
        },
        "end": {
          "line": 3563,
          "column": 62
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3564,
          "column": 3
        },
        "end": {
          "line": 3564,
          "column": 99
        }
      }
    ],
    "aliases": [
      "@typed/fx#RefSubject.transform"
    ],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:1df58e2ae708e2eea3cc8510",
    "name": "transform",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const transform: {\n    <A, B>(toB: (a: A) => B, toA: (b: B) => A): <E, R>(ref: RefSubject<A, E, R>) => RefSubject<B, E, R>;\n    <A, E, R, B>(ref: RefSubject<A, E, R>, toB: (a: A) => B, toA: (b: B) => A): RefSubject<B, E, R>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 3559,
              "column": 14
            },
            "end": {
              "line": 3572,
              "column": 3
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<A, B>(toB: (a: A) => B, toA: (b: B) => A): <E, R>(ref: RefSubject<A, E, R>) => RefSubject<B, E, R>;",
          "<A, E, R, B>(ref: RefSubject<A, E, R>, toB: (a: A) => B, toA: (b: B) => A): RefSubject<B, E, R>;"
        ],
        "typeParameters": [
          "A",
          "B",
          "E",
          "R"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 3560,
              "column": 3
            },
            "end": {
              "line": 3563,
              "column": 62
            }
          },
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 3564,
              "column": 3
            },
            "end": {
              "line": 3564,
              "column": 99
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const transform: {\n    <A, B>(toB: (a: A) => B, toA: (b: B) => A): <E, R>(ref: RefSubject<A, E, R>) => RefSubject<B, E, R>;\n    <A, E, R, B>(ref: RefSubject<A, E, R>, toB: (a: A) => B, toA: (b: B) => A): RefSubject<B, E, R>;\n};"
    ],
    "typeParameters": [
      "A",
      "B",
      "E",
      "R"
    ],
    "summary": "Transforms a `RefSubject` invariantly using bidirectional mapping functions.",
    "sections": {
      "Why": "Creates a bidirectional lens over state: reads map outward and writes map back to the original\nRefSubject without allocating a second store.",
      "Ownership and lifetime": "The derived ref owns no independent state or subscription. It follows the source lifetime and\nroutes writes through the source's synchronized update boundary."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport * as RefSubject from \"@typed/fx/RefSubject\"\n\nconst program = Effect.gen(function* () {\n  const count = yield* RefSubject.make(5)\n\n  // Transform to string and back\n  const countStr = RefSubject.transform(\n    count,\n    (n) => n.toString(),\n    (s) => parseInt(s, 10)\n  )\n\n  const value = yield* countStr\n  console.log(value) // \"5\"\n\n  // Set using the transformed type\n  yield* RefSubject.set(countStr, \"10\")\n\n  // Original reflects the change\n  const original = yield* count\n  console.log(original) // 10\n})"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3559,
          "column": 14
        },
        "end": {
          "line": 3572,
          "column": 3
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3560,
          "column": 3
        },
        "end": {
          "line": 3563,
          "column": 62
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3564,
          "column": 3
        },
        "end": {
          "line": 3564,
          "column": 99
        }
      }
    ],
    "since": "1.0.0",
    "category": "Writable views"
  }
}
