{
  "id": "@typed/fx#RefSubject.fromFx",
  "canonicalId": "@typed/fx/RefSubject#fromFx",
  "symbol": {
    "id": "@typed/fx#RefSubject.fromFx",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "RefSubject.fromFx",
    "kind": "function",
    "signatures": [
      "export declare function fromFx<A, E, R>(fx: Fx<A, E, R>, options?: RefSubjectOptions<A>): Effect.Effect<RefSubject<A, E>, never, R | Scope.Scope>;"
    ],
    "summary": "Creates a `RefSubject` from an `Fx`, tracking the latest emitted value.",
    "sections": {
      "Why": "Makes fx acquisition explicit while normalizing it into current RefSubject state and subsequent\npushed versions.",
      "Ownership and lifetime": "The creation Effect requires Scope. It owns initializer acquisition, live source subscriptions,\nand cleanup; source failures and services stay on reads and pushes."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport * as RefSubject from \"@typed/fx/RefSubject\"\nimport { Fx } from \"@typed/fx\"\n\nconst program = Effect.gen(function* () {\n  // Create an Fx that emits multiple values\n  const numbers = Fx.fromIterable([1, 2, 3, 4, 5])\n\n  // Create a RefSubject that tracks the latest value\n  const ref = yield* RefSubject.fromFx(numbers)\n\n  // Get the latest value\n  const latest = yield* ref\n  console.log(latest) // 5\n})"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/RefSubject/RefSubject.ts",
      "line": 1736
    },
    "since": "1.0.0",
    "category": "Source adapters"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#RefSubject.fromFx",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.13",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "RefSubject",
    "qualifiedName": "RefSubject.fromFx",
    "declarationKey": "declaration:cd2533776d4be708f3d27743",
    "family": "function",
    "signatures": [
      "export declare function fromFx<A, E, R>(fx: Fx<A, E, R>, options?: RefSubjectOptions<A>): Effect.Effect<RefSubject<A, E>, never, R | Scope.Scope>;"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 1736,
          "column": 1
        },
        "end": {
          "line": 1757,
          "column": 2
        }
      }
    ],
    "aliases": [
      "@typed/fx/RefSubject#fromFx"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#RefSubject",
    "static": false,
    "importedFrom": "declaration:cd2533776d4be708f3d27743"
  },
  "declaration": {
    "declarationKey": "declaration:cd2533776d4be708f3d27743",
    "name": "fromFx",
    "family": "function",
    "facets": [
      {
        "family": "function",
        "syntaxKind": "FunctionDeclaration",
        "signatures": [
          "export declare function fromFx<A, E, R>(fx: Fx<A, E, R>, options?: RefSubjectOptions<A>): Effect.Effect<RefSubject<A, E>, never, R | Scope.Scope>;"
        ],
        "typeParameters": [
          "A",
          "E",
          "R"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 1736,
              "column": 1
            },
            "end": {
              "line": 1757,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare function fromFx<A, E, R>(fx: Fx<A, E, R>, options?: RefSubjectOptions<A>): Effect.Effect<RefSubject<A, E>, never, R | Scope.Scope>;"
    ],
    "typeParameters": [
      "A",
      "E",
      "R"
    ],
    "summary": "Creates a `RefSubject` from an `Fx`, tracking the latest emitted value.",
    "sections": {
      "Why": "Makes fx acquisition explicit while normalizing it into current RefSubject state and subsequent\npushed versions.",
      "Ownership and lifetime": "The creation Effect requires Scope. It owns initializer acquisition, live source subscriptions,\nand cleanup; source failures and services stay on reads and pushes."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport * as RefSubject from \"@typed/fx/RefSubject\"\nimport { Fx } from \"@typed/fx\"\n\nconst program = Effect.gen(function* () {\n  // Create an Fx that emits multiple values\n  const numbers = Fx.fromIterable([1, 2, 3, 4, 5])\n\n  // Create a RefSubject that tracks the latest value\n  const ref = yield* RefSubject.fromFx(numbers)\n\n  // Get the latest value\n  const latest = yield* ref\n  console.log(latest) // 5\n})"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 1736,
          "column": 1
        },
        "end": {
          "line": 1757,
          "column": 2
        }
      }
    ],
    "since": "1.0.0",
    "category": "Source adapters"
  }
}
