{
  "id": "@typed/fx/RefSubject#fromEffect",
  "canonicalId": "@typed/fx/RefSubject#fromEffect",
  "symbol": {
    "id": "@typed/fx/RefSubject#fromEffect",
    "packageName": "@typed/fx",
    "moduleName": "RefSubject",
    "exportName": "fromEffect",
    "kind": "function",
    "signatures": [
      "export declare function fromEffect<A, E, R>(effect: Effect.Effect<A, E, R>, options?: RefSubjectOptions<A>): Effect.Effect<RefSubject<A, E>, never, R | Scope.Scope>;"
    ],
    "summary": "Creates a `RefSubject` from an `Effect`.",
    "sections": {
      "Why": "Makes effect acquisition explicit while normalizing it into current RefSubject state and\nsubsequent pushed versions.",
      "Ownership and lifetime": "The creation Effect requires Scope and the source's services, which it captures for the private\ninitializer Scope. The source Effect itself stays deferred until the first current read or\nobservation and runs at most once. Source failures remain visible on reads and observations;\nclosing the creation Scope interrupts an initializer that is still running."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport * as RefSubject from \"@typed/fx/RefSubject\"\n\nconst program = Effect.gen(function* () {\n  const ref = yield* RefSubject.fromEffect(\n    Effect.succeed(\"Initial value\")\n  )\n\n  const value = yield* ref\n  console.log(value) // \"Initial value\"\n})"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/RefSubject/RefSubject.ts",
      "line": 1688
    },
    "since": "1.0.0",
    "category": "Source adapters"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx/RefSubject#fromEffect",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.7",
    "moduleName": "RefSubject",
    "consumerSpecifier": "@typed/fx/RefSubject",
    "exportName": "fromEffect",
    "qualifiedName": "fromEffect",
    "declarationKey": "declaration:40330771165946fd2b2a3343",
    "family": "function",
    "signatures": [
      "export declare function fromEffect<A, E, R>(effect: Effect.Effect<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": 1688,
          "column": 1
        },
        "end": {
          "line": 1693,
          "column": 2
        }
      }
    ],
    "aliases": [
      "@typed/fx#RefSubject.fromEffect"
    ],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:40330771165946fd2b2a3343",
    "name": "fromEffect",
    "family": "function",
    "facets": [
      {
        "family": "function",
        "syntaxKind": "FunctionDeclaration",
        "signatures": [
          "export declare function fromEffect<A, E, R>(effect: Effect.Effect<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": 1688,
              "column": 1
            },
            "end": {
              "line": 1693,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare function fromEffect<A, E, R>(effect: Effect.Effect<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 `Effect`.",
    "sections": {
      "Why": "Makes effect acquisition explicit while normalizing it into current RefSubject state and\nsubsequent pushed versions.",
      "Ownership and lifetime": "The creation Effect requires Scope and the source's services, which it captures for the private\ninitializer Scope. The source Effect itself stays deferred until the first current read or\nobservation and runs at most once. Source failures remain visible on reads and observations;\nclosing the creation Scope interrupts an initializer that is still running."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport * as RefSubject from \"@typed/fx/RefSubject\"\n\nconst program = Effect.gen(function* () {\n  const ref = yield* RefSubject.fromEffect(\n    Effect.succeed(\"Initial value\")\n  )\n\n  const value = yield* ref\n  console.log(value) // \"Initial value\"\n})"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 1688,
          "column": 1
        },
        "end": {
          "line": 1693,
          "column": 2
        }
      }
    ],
    "since": "1.0.0",
    "category": "Source adapters"
  }
}
