{
  "id": "@typed/fx#RefSubject.map",
  "canonicalId": "@typed/fx/RefSubject#map",
  "symbol": {
    "id": "@typed/fx#RefSubject.map",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "RefSubject.map",
    "kind": "constant",
    "signatures": [
      "export declare const map: {\n    <T extends RefSubject.Any | Computed.Any | Filtered.Any, B>(f: (a: Success<T>) => B): (ref: T) => T extends Filtered.Any ? Filtered<B, Error<T>, Services<T>> : Computed<B, Error<T>, Services<T>>;\n    <A, E, R, B>(ref: RefSubject<A, E, R> | Computed<A, E, R>, f: (a: A) => B): Computed<B, E, R>;\n    <A, E, R, B>(filtered: Filtered<A, E, R>, f: (a: A) => B): Filtered<B, E, R>;\n    <R0, E0, A, E, R, B, E2, R2>(versioned: Versioned.Versioned<R0, E0, A, E, R, A, E2, R2>, f: (a: A) => B): Computed<B, E0 | E | E2, R0 | R2 | Exclude<R, Scope.Scope>> | Filtered<B, E0 | E | E2, R0 | R2 | Exclude<R, Scope.Scope>>;\n};"
    ],
    "summary": "Transforms a `RefSubject`, `Computed`, or `Filtered` using a pure function.",
    "sections": {
      "Why": "`map` creates derived state instead of copying source state into a component.\nReads and pushed updates remain connected to the original `Versioned` value,\nso a projection can be tested without rendering and consumed by any renderer.",
      "Ownership and lifetime": "The returned `Computed` or `Filtered` view does not take ownership of the\nsource. It follows the source lifetime and preserves its error and service\nchannels. The pure mapping function adds neither resources nor failures.",
      "Re-computation": "The mapping function runs for the current value and subsequent committed\nsource versions. Updates still occur on the writable source; the derived view\nis read-only unless a more specific bidirectional combinator is used."
    },
    "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  // Create a computed that doubles the count\n  const doubled = RefSubject.map(count, (n) => n * 2)\n\n  const value = yield* doubled\n  console.log(value) // 10\n\n  // Update source\n  yield* RefSubject.set(count, 7)\n\n  // Computed automatically updates\n  const newValue = yield* doubled\n  console.log(newValue) // 14\n})"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/RefSubject/RefSubject.ts",
      "line": 3085
    },
    "since": "1.0.0",
    "category": "Derived queries"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#RefSubject.map",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.13",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "RefSubject",
    "qualifiedName": "RefSubject.map",
    "declarationKey": "declaration:49d5fdc3028b1dbbce1ce28d",
    "family": "variable",
    "signatures": [
      "export declare const map: {\n    <T extends RefSubject.Any | Computed.Any | Filtered.Any, B>(f: (a: Success<T>) => B): (ref: T) => T extends Filtered.Any ? Filtered<B, Error<T>, Services<T>> : Computed<B, Error<T>, Services<T>>;\n    <A, E, R, B>(ref: RefSubject<A, E, R> | Computed<A, E, R>, f: (a: A) => B): Computed<B, E, R>;\n    <A, E, R, B>(filtered: Filtered<A, E, R>, f: (a: A) => B): Filtered<B, E, R>;\n    <R0, E0, A, E, R, B, E2, R2>(versioned: Versioned.Versioned<R0, E0, A, E, R, A, E2, R2>, f: (a: A) => B): Computed<B, E0 | E | E2, R0 | R2 | Exclude<R, Scope.Scope>> | Filtered<B, E0 | E | E2, R0 | R2 | Exclude<R, Scope.Scope>>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3085,
          "column": 14
        },
        "end": {
          "line": 3116,
          "column": 3
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3086,
          "column": 3
        },
        "end": {
          "line": 3092,
          "column": 42
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3094,
          "column": 3
        },
        "end": {
          "line": 3094,
          "column": 97
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3095,
          "column": 3
        },
        "end": {
          "line": 3095,
          "column": 80
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3097,
          "column": 3
        },
        "end": {
          "line": 3102,
          "column": 67
        }
      }
    ],
    "aliases": [
      "@typed/fx/RefSubject#map"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#RefSubject",
    "static": false,
    "importedFrom": "declaration:49d5fdc3028b1dbbce1ce28d"
  },
  "declaration": {
    "declarationKey": "declaration:49d5fdc3028b1dbbce1ce28d",
    "name": "map",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const map: {\n    <T extends RefSubject.Any | Computed.Any | Filtered.Any, B>(f: (a: Success<T>) => B): (ref: T) => T extends Filtered.Any ? Filtered<B, Error<T>, Services<T>> : Computed<B, Error<T>, Services<T>>;\n    <A, E, R, B>(ref: RefSubject<A, E, R> | Computed<A, E, R>, f: (a: A) => B): Computed<B, E, R>;\n    <A, E, R, B>(filtered: Filtered<A, E, R>, f: (a: A) => B): Filtered<B, E, R>;\n    <R0, E0, A, E, R, B, E2, R2>(versioned: Versioned.Versioned<R0, E0, A, E, R, A, E2, R2>, f: (a: A) => B): Computed<B, E0 | E | E2, R0 | R2 | Exclude<R, Scope.Scope>> | Filtered<B, E0 | E | E2, R0 | R2 | Exclude<R, Scope.Scope>>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 3085,
              "column": 14
            },
            "end": {
              "line": 3116,
              "column": 3
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<T extends RefSubject.Any | Computed.Any | Filtered.Any, B>(f: (a: Success<T>) => B): (ref: T) => T extends Filtered.Any ? Filtered<B, Error<T>, Services<T>> : Computed<B, Error<T>, Services<T>>;",
          "<A, E, R, B>(ref: RefSubject<A, E, R> | Computed<A, E, R>, f: (a: A) => B): Computed<B, E, R>;",
          "<A, E, R, B>(filtered: Filtered<A, E, R>, f: (a: A) => B): Filtered<B, E, R>;",
          "<R0, E0, A, E, R, B, E2, R2>(versioned: Versioned.Versioned<R0, E0, A, E, R, A, E2, R2>, f: (a: A) => B): Computed<B, E0 | E | E2, R0 | R2 | Exclude<R, Scope.Scope>> | Filtered<B, E0 | E | E2, R0 | R2 | Exclude<R, Scope.Scope>>;"
        ],
        "typeParameters": [
          "T extends RefSubject.Any | Computed.Any | Filtered.Any",
          "B",
          "A",
          "E",
          "R",
          "R0",
          "E0",
          "E2",
          "R2"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 3086,
              "column": 3
            },
            "end": {
              "line": 3092,
              "column": 42
            }
          },
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 3094,
              "column": 3
            },
            "end": {
              "line": 3094,
              "column": 97
            }
          },
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 3095,
              "column": 3
            },
            "end": {
              "line": 3095,
              "column": 80
            }
          },
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 3097,
              "column": 3
            },
            "end": {
              "line": 3102,
              "column": 67
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const map: {\n    <T extends RefSubject.Any | Computed.Any | Filtered.Any, B>(f: (a: Success<T>) => B): (ref: T) => T extends Filtered.Any ? Filtered<B, Error<T>, Services<T>> : Computed<B, Error<T>, Services<T>>;\n    <A, E, R, B>(ref: RefSubject<A, E, R> | Computed<A, E, R>, f: (a: A) => B): Computed<B, E, R>;\n    <A, E, R, B>(filtered: Filtered<A, E, R>, f: (a: A) => B): Filtered<B, E, R>;\n    <R0, E0, A, E, R, B, E2, R2>(versioned: Versioned.Versioned<R0, E0, A, E, R, A, E2, R2>, f: (a: A) => B): Computed<B, E0 | E | E2, R0 | R2 | Exclude<R, Scope.Scope>> | Filtered<B, E0 | E | E2, R0 | R2 | Exclude<R, Scope.Scope>>;\n};"
    ],
    "typeParameters": [
      "T extends RefSubject.Any | Computed.Any | Filtered.Any",
      "B",
      "A",
      "E",
      "R",
      "R0",
      "E0",
      "E2",
      "R2"
    ],
    "summary": "Transforms a `RefSubject`, `Computed`, or `Filtered` using a pure function.",
    "sections": {
      "Why": "`map` creates derived state instead of copying source state into a component.\nReads and pushed updates remain connected to the original `Versioned` value,\nso a projection can be tested without rendering and consumed by any renderer.",
      "Ownership and lifetime": "The returned `Computed` or `Filtered` view does not take ownership of the\nsource. It follows the source lifetime and preserves its error and service\nchannels. The pure mapping function adds neither resources nor failures.",
      "Re-computation": "The mapping function runs for the current value and subsequent committed\nsource versions. Updates still occur on the writable source; the derived view\nis read-only unless a more specific bidirectional combinator is used."
    },
    "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  // Create a computed that doubles the count\n  const doubled = RefSubject.map(count, (n) => n * 2)\n\n  const value = yield* doubled\n  console.log(value) // 10\n\n  // Update source\n  yield* RefSubject.set(count, 7)\n\n  // Computed automatically updates\n  const newValue = yield* doubled\n  console.log(newValue) // 14\n})"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3085,
          "column": 14
        },
        "end": {
          "line": 3116,
          "column": 3
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3086,
          "column": 3
        },
        "end": {
          "line": 3092,
          "column": 42
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3094,
          "column": 3
        },
        "end": {
          "line": 3094,
          "column": 97
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3095,
          "column": 3
        },
        "end": {
          "line": 3095,
          "column": 80
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3097,
          "column": 3
        },
        "end": {
          "line": 3102,
          "column": 67
        }
      }
    ],
    "since": "1.0.0",
    "category": "Derived queries"
  }
}
