{
  "id": "@typed/fx#RefSubject.fromOption",
  "canonicalId": "@typed/fx/RefSubject#fromOption",
  "symbol": {
    "id": "@typed/fx#RefSubject.fromOption",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "RefSubject.fromOption",
    "kind": "function",
    "signatures": [
      "export declare function fromOption<A>(option: Option.Option<A>, options?: RefSubjectOptions<Option.Option<A>>): Effect.Effect<RefSubject<Option.Option<A>>, never, Scope.Scope>;"
    ],
    "summary": "Creates a `RefSubject` from an `Option` value.",
    "sections": {
      "Why": "Stores the Option itself in writable state. `None` is an ordinary current value and does not add\n`NoSuchElementError`; callers opt into absence semantics with `compact`, or a fallback with\n`getOrElse`.",
      "Ownership and lifetime": "Construction requires Scope because it delegates to `make`, but the supplied Option needs no\nservices and cannot fail. The returned RefSubject owns and publishes subsequent Option writes."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect, Option } from \"effect\"\nimport * as RefSubject from \"@typed/fx/RefSubject\"\n\nconst program = Effect.gen(function* () {\n  const ref = yield* RefSubject.fromOption(Option.some(42))\n  const value = yield* ref\n  console.log(Option.isSome(value)) // true\n})"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/RefSubject/RefSubject.ts",
      "line": 1825
    },
    "since": "1.0.0",
    "category": "Source adapters"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#RefSubject.fromOption",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.7",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "RefSubject",
    "qualifiedName": "RefSubject.fromOption",
    "declarationKey": "declaration:2144f019fff5debf38128524",
    "family": "function",
    "signatures": [
      "export declare function fromOption<A>(option: Option.Option<A>, options?: RefSubjectOptions<Option.Option<A>>): Effect.Effect<RefSubject<Option.Option<A>>, never, Scope.Scope>;"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 1825,
          "column": 1
        },
        "end": {
          "line": 1830,
          "column": 2
        }
      }
    ],
    "aliases": [
      "@typed/fx/RefSubject#fromOption"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#RefSubject",
    "static": false,
    "importedFrom": "declaration:2144f019fff5debf38128524"
  },
  "declaration": {
    "declarationKey": "declaration:2144f019fff5debf38128524",
    "name": "fromOption",
    "family": "function",
    "facets": [
      {
        "family": "function",
        "syntaxKind": "FunctionDeclaration",
        "signatures": [
          "export declare function fromOption<A>(option: Option.Option<A>, options?: RefSubjectOptions<Option.Option<A>>): Effect.Effect<RefSubject<Option.Option<A>>, never, Scope.Scope>;"
        ],
        "typeParameters": [
          "A"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 1825,
              "column": 1
            },
            "end": {
              "line": 1830,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare function fromOption<A>(option: Option.Option<A>, options?: RefSubjectOptions<Option.Option<A>>): Effect.Effect<RefSubject<Option.Option<A>>, never, Scope.Scope>;"
    ],
    "typeParameters": [
      "A"
    ],
    "summary": "Creates a `RefSubject` from an `Option` value.",
    "sections": {
      "Why": "Stores the Option itself in writable state. `None` is an ordinary current value and does not add\n`NoSuchElementError`; callers opt into absence semantics with `compact`, or a fallback with\n`getOrElse`.",
      "Ownership and lifetime": "Construction requires Scope because it delegates to `make`, but the supplied Option needs no\nservices and cannot fail. The returned RefSubject owns and publishes subsequent Option writes."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect, Option } from \"effect\"\nimport * as RefSubject from \"@typed/fx/RefSubject\"\n\nconst program = Effect.gen(function* () {\n  const ref = yield* RefSubject.fromOption(Option.some(42))\n  const value = yield* ref\n  console.log(Option.isSome(value)) // true\n})"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 1825,
          "column": 1
        },
        "end": {
          "line": 1830,
          "column": 2
        }
      }
    ],
    "since": "1.0.0",
    "category": "Source adapters"
  }
}
