{
  "id": "@typed/fx#RefSubject.mapEffect",
  "canonicalId": "@typed/fx/RefSubject#mapEffect",
  "symbol": {
    "id": "@typed/fx#RefSubject.mapEffect",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "RefSubject.mapEffect",
    "kind": "constant",
    "signatures": [
      "export declare const mapEffect: {\n    <T extends RefSubject.Any | Computed.Any | Filtered.Any, B, E2, R2>(f: (a: Success<T>) => Effect.Effect<B, E2, R2>): (ref: T) => T extends Filtered.Any ? Filtered<B, Error<T> | E2, Services<T> | R2> : Computed<B, Error<T> | E2, Services<T> | R2>;\n    <A, E, R, B, E2, R2>(ref: RefSubject<A, E, R> | Computed<A, E, R>, f: (a: A) => Effect.Effect<B, E2, R2>): Computed<B, E | E2, R | R2>;\n    <A, E, R, B, E2, R2>(ref: Filtered<A, E, R>, f: (a: A) => Effect.Effect<B, E2, R2>): Filtered<B, E | E2, R | R2>;\n    <R0, E0, A, E, R, E2, R2, C, E3, R3>(versioned: Versioned.Versioned<R0, E0, A, E, R, A, E2, R2>, f: (a: A) => Effect.Effect<C, E3, R3>): Computed<C, E0 | E | E2 | E3, R0 | R2 | R3 | Exclude<R, Scope.Scope>>;\n};"
    ],
    "summary": "Transforms a `RefSubject`, `Computed`, or `Filtered` using an `Effect`ful function.",
    "sections": {
      "Why": "Applies one Effectful derivation to current reads and pushed versions. RefSubject and Computed\ninputs return Computed and add only `E2`; a Filtered input returns Filtered and preserves its\nconditional absence in addition to `E2`.",
      "Ownership and lifetime": "No callback runs until the result is read or observed. Computed results cannot become absent and\ndo not add `NoSuchElementError`; only the Filtered overload can fail a current read for absence.\nCallback services and failures remain `R2` and `E2`, and the observing Scope owns subscription\ncleanup."
    },
    "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 with an async operation\n  const doubled = RefSubject.mapEffect(count, (n) =>\n    Effect.succeed(n * 2)\n  )\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": 2990
    },
    "since": "1.0.0",
    "category": "Derived queries"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#RefSubject.mapEffect",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.7",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "RefSubject",
    "qualifiedName": "RefSubject.mapEffect",
    "declarationKey": "declaration:a25cbf217153a4ed14f2bbf9",
    "family": "variable",
    "signatures": [
      "export declare const mapEffect: {\n    <T extends RefSubject.Any | Computed.Any | Filtered.Any, B, E2, R2>(f: (a: Success<T>) => Effect.Effect<B, E2, R2>): (ref: T) => T extends Filtered.Any ? Filtered<B, Error<T> | E2, Services<T> | R2> : Computed<B, Error<T> | E2, Services<T> | R2>;\n    <A, E, R, B, E2, R2>(ref: RefSubject<A, E, R> | Computed<A, E, R>, f: (a: A) => Effect.Effect<B, E2, R2>): Computed<B, E | E2, R | R2>;\n    <A, E, R, B, E2, R2>(ref: Filtered<A, E, R>, f: (a: A) => Effect.Effect<B, E2, R2>): Filtered<B, E | E2, R | R2>;\n    <R0, E0, A, E, R, E2, R2, C, E3, R3>(versioned: Versioned.Versioned<R0, E0, A, E, R, A, E2, R2>, f: (a: A) => Effect.Effect<C, E3, R3>): Computed<C, E0 | E | E2 | E3, R0 | R2 | R3 | Exclude<R, Scope.Scope>>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 2990,
          "column": 14
        },
        "end": {
          "line": 3030,
          "column": 3
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 2991,
          "column": 3
        },
        "end": {
          "line": 2997,
          "column": 52
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 2999,
          "column": 3
        },
        "end": {
          "line": 3002,
          "column": 34
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3004,
          "column": 3
        },
        "end": {
          "line": 3007,
          "column": 34
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3009,
          "column": 3
        },
        "end": {
          "line": 3012,
          "column": 76
        }
      }
    ],
    "aliases": [
      "@typed/fx/RefSubject#mapEffect"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#RefSubject",
    "static": false,
    "importedFrom": "declaration:a25cbf217153a4ed14f2bbf9"
  },
  "declaration": {
    "declarationKey": "declaration:a25cbf217153a4ed14f2bbf9",
    "name": "mapEffect",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const mapEffect: {\n    <T extends RefSubject.Any | Computed.Any | Filtered.Any, B, E2, R2>(f: (a: Success<T>) => Effect.Effect<B, E2, R2>): (ref: T) => T extends Filtered.Any ? Filtered<B, Error<T> | E2, Services<T> | R2> : Computed<B, Error<T> | E2, Services<T> | R2>;\n    <A, E, R, B, E2, R2>(ref: RefSubject<A, E, R> | Computed<A, E, R>, f: (a: A) => Effect.Effect<B, E2, R2>): Computed<B, E | E2, R | R2>;\n    <A, E, R, B, E2, R2>(ref: Filtered<A, E, R>, f: (a: A) => Effect.Effect<B, E2, R2>): Filtered<B, E | E2, R | R2>;\n    <R0, E0, A, E, R, E2, R2, C, E3, R3>(versioned: Versioned.Versioned<R0, E0, A, E, R, A, E2, R2>, f: (a: A) => Effect.Effect<C, E3, R3>): Computed<C, E0 | E | E2 | E3, R0 | R2 | R3 | Exclude<R, Scope.Scope>>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 2990,
              "column": 14
            },
            "end": {
              "line": 3030,
              "column": 3
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<T extends RefSubject.Any | Computed.Any | Filtered.Any, B, E2, R2>(f: (a: Success<T>) => Effect.Effect<B, E2, R2>): (ref: T) => T extends Filtered.Any ? Filtered<B, Error<T> | E2, Services<T> | R2> : Computed<B, Error<T> | E2, Services<T> | R2>;",
          "<A, E, R, B, E2, R2>(ref: RefSubject<A, E, R> | Computed<A, E, R>, f: (a: A) => Effect.Effect<B, E2, R2>): Computed<B, E | E2, R | R2>;",
          "<A, E, R, B, E2, R2>(ref: Filtered<A, E, R>, f: (a: A) => Effect.Effect<B, E2, R2>): Filtered<B, E | E2, R | R2>;",
          "<R0, E0, A, E, R, E2, R2, C, E3, R3>(versioned: Versioned.Versioned<R0, E0, A, E, R, A, E2, R2>, f: (a: A) => Effect.Effect<C, E3, R3>): Computed<C, E0 | E | E2 | E3, R0 | R2 | R3 | Exclude<R, Scope.Scope>>;"
        ],
        "typeParameters": [
          "T extends RefSubject.Any | Computed.Any | Filtered.Any",
          "B",
          "E2",
          "R2",
          "A",
          "E",
          "R",
          "R0",
          "E0",
          "C",
          "E3",
          "R3"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 2991,
              "column": 3
            },
            "end": {
              "line": 2997,
              "column": 52
            }
          },
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 2999,
              "column": 3
            },
            "end": {
              "line": 3002,
              "column": 34
            }
          },
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 3004,
              "column": 3
            },
            "end": {
              "line": 3007,
              "column": 34
            }
          },
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 3009,
              "column": 3
            },
            "end": {
              "line": 3012,
              "column": 76
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const mapEffect: {\n    <T extends RefSubject.Any | Computed.Any | Filtered.Any, B, E2, R2>(f: (a: Success<T>) => Effect.Effect<B, E2, R2>): (ref: T) => T extends Filtered.Any ? Filtered<B, Error<T> | E2, Services<T> | R2> : Computed<B, Error<T> | E2, Services<T> | R2>;\n    <A, E, R, B, E2, R2>(ref: RefSubject<A, E, R> | Computed<A, E, R>, f: (a: A) => Effect.Effect<B, E2, R2>): Computed<B, E | E2, R | R2>;\n    <A, E, R, B, E2, R2>(ref: Filtered<A, E, R>, f: (a: A) => Effect.Effect<B, E2, R2>): Filtered<B, E | E2, R | R2>;\n    <R0, E0, A, E, R, E2, R2, C, E3, R3>(versioned: Versioned.Versioned<R0, E0, A, E, R, A, E2, R2>, f: (a: A) => Effect.Effect<C, E3, R3>): Computed<C, E0 | E | E2 | E3, R0 | R2 | R3 | Exclude<R, Scope.Scope>>;\n};"
    ],
    "typeParameters": [
      "T extends RefSubject.Any | Computed.Any | Filtered.Any",
      "B",
      "E2",
      "R2",
      "A",
      "E",
      "R",
      "R0",
      "E0",
      "C",
      "E3",
      "R3"
    ],
    "summary": "Transforms a `RefSubject`, `Computed`, or `Filtered` using an `Effect`ful function.",
    "sections": {
      "Why": "Applies one Effectful derivation to current reads and pushed versions. RefSubject and Computed\ninputs return Computed and add only `E2`; a Filtered input returns Filtered and preserves its\nconditional absence in addition to `E2`.",
      "Ownership and lifetime": "No callback runs until the result is read or observed. Computed results cannot become absent and\ndo not add `NoSuchElementError`; only the Filtered overload can fail a current read for absence.\nCallback services and failures remain `R2` and `E2`, and the observing Scope owns subscription\ncleanup."
    },
    "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 with an async operation\n  const doubled = RefSubject.mapEffect(count, (n) =>\n    Effect.succeed(n * 2)\n  )\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": 2990,
          "column": 14
        },
        "end": {
          "line": 3030,
          "column": 3
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 2991,
          "column": 3
        },
        "end": {
          "line": 2997,
          "column": 52
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 2999,
          "column": 3
        },
        "end": {
          "line": 3002,
          "column": 34
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3004,
          "column": 3
        },
        "end": {
          "line": 3007,
          "column": 34
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3009,
          "column": 3
        },
        "end": {
          "line": 3012,
          "column": 76
        }
      }
    ],
    "since": "1.0.0",
    "category": "Derived queries"
  }
}
