{
  "id": "@typed/fx/RefSubject#getOrElse",
  "canonicalId": "@typed/fx/RefSubject#getOrElse",
  "symbol": {
    "id": "@typed/fx/RefSubject#getOrElse",
    "packageName": "@typed/fx",
    "moduleName": "RefSubject",
    "exportName": "getOrElse",
    "kind": "constant",
    "signatures": [
      "export declare const getOrElse: {\n    <A>(fallback: () => A): <E, R>(ref: Computed<Option.Option<A>, E, R> | Filtered<A, E, R>) => Computed<A, E, R>;\n    <A, E, R>(ref: Computed<Option.Option<A>, E, R> | Filtered<A, E, R>, fallback: () => A): Computed<A, E, R>;\n};"
    ],
    "summary": "Returns a `Computed` that yields the value inside the `Option`, or the fallback when `None`.\nWorks with `Computed<Option<A>>` (e.g. from `fromOption` / `fromNullable`) and with `Filtered<A>`.",
    "sections": {
      "Why": "Returns a `Computed` that yields the value inside the `Option`, or the fallback when `None`.\nWorks with `Computed<Option<A>>` (e.g. from `fromOption` / `fromNullable`) and with\n`Filtered<A>`. Current reads and pushed versions use the same derivation, preventing snapshot\nand subscription behavior from diverging.",
      "Ownership and lifetime": "The returned Computed never fails for absence: `None` or an absent Filtered value invokes\n`fallback`. It preserves only the input's declared `E` and `R`; the pure fallback adds no failure,\nservice, subscription, or retained value."
    },
    "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 withDefault = RefSubject.getOrElse(ref, () => 0)\n  expect(yield* withDefault).toBe(42)\n\n  const empty = yield* RefSubject.fromNullable(null)\n  const fallback = RefSubject.getOrElse(empty, () => 99)\n  expect(yield* fallback).toBe(99)\n})"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/RefSubject/RefSubject.ts",
      "line": 3358
    },
    "since": "1.0.0",
    "category": "Optional queries"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx/RefSubject#getOrElse",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.13",
    "moduleName": "RefSubject",
    "consumerSpecifier": "@typed/fx/RefSubject",
    "exportName": "getOrElse",
    "qualifiedName": "getOrElse",
    "declarationKey": "declaration:f4301abedbb66eb5c9ea6e62",
    "family": "variable",
    "signatures": [
      "export declare const getOrElse: {\n    <A>(fallback: () => A): <E, R>(ref: Computed<Option.Option<A>, E, R> | Filtered<A, E, R>) => Computed<A, E, R>;\n    <A, E, R>(ref: Computed<Option.Option<A>, E, R> | Filtered<A, E, R>, fallback: () => A): Computed<A, E, R>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3358,
          "column": 14
        },
        "end": {
          "line": 3373,
          "column": 3
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3359,
          "column": 3
        },
        "end": {
          "line": 3361,
          "column": 93
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3362,
          "column": 3
        },
        "end": {
          "line": 3365,
          "column": 24
        }
      }
    ],
    "aliases": [
      "@typed/fx#RefSubject.getOrElse"
    ],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:f4301abedbb66eb5c9ea6e62",
    "name": "getOrElse",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const getOrElse: {\n    <A>(fallback: () => A): <E, R>(ref: Computed<Option.Option<A>, E, R> | Filtered<A, E, R>) => Computed<A, E, R>;\n    <A, E, R>(ref: Computed<Option.Option<A>, E, R> | Filtered<A, E, R>, fallback: () => A): Computed<A, E, R>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 3358,
              "column": 14
            },
            "end": {
              "line": 3373,
              "column": 3
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<A>(fallback: () => A): <E, R>(ref: Computed<Option.Option<A>, E, R> | Filtered<A, E, R>) => Computed<A, E, R>;",
          "<A, E, R>(ref: Computed<Option.Option<A>, E, R> | Filtered<A, E, R>, fallback: () => A): Computed<A, E, R>;"
        ],
        "typeParameters": [
          "A",
          "E",
          "R"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 3359,
              "column": 3
            },
            "end": {
              "line": 3361,
              "column": 93
            }
          },
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 3362,
              "column": 3
            },
            "end": {
              "line": 3365,
              "column": 24
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const getOrElse: {\n    <A>(fallback: () => A): <E, R>(ref: Computed<Option.Option<A>, E, R> | Filtered<A, E, R>) => Computed<A, E, R>;\n    <A, E, R>(ref: Computed<Option.Option<A>, E, R> | Filtered<A, E, R>, fallback: () => A): Computed<A, E, R>;\n};"
    ],
    "typeParameters": [
      "A",
      "E",
      "R"
    ],
    "summary": "Returns a `Computed` that yields the value inside the `Option`, or the fallback when `None`.\nWorks with `Computed<Option<A>>` (e.g. from `fromOption` / `fromNullable`) and with `Filtered<A>`.",
    "sections": {
      "Why": "Returns a `Computed` that yields the value inside the `Option`, or the fallback when `None`.\nWorks with `Computed<Option<A>>` (e.g. from `fromOption` / `fromNullable`) and with\n`Filtered<A>`. Current reads and pushed versions use the same derivation, preventing snapshot\nand subscription behavior from diverging.",
      "Ownership and lifetime": "The returned Computed never fails for absence: `None` or an absent Filtered value invokes\n`fallback`. It preserves only the input's declared `E` and `R`; the pure fallback adds no failure,\nservice, subscription, or retained value."
    },
    "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 withDefault = RefSubject.getOrElse(ref, () => 0)\n  expect(yield* withDefault).toBe(42)\n\n  const empty = yield* RefSubject.fromNullable(null)\n  const fallback = RefSubject.getOrElse(empty, () => 99)\n  expect(yield* fallback).toBe(99)\n})"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3358,
          "column": 14
        },
        "end": {
          "line": 3373,
          "column": 3
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3359,
          "column": 3
        },
        "end": {
          "line": 3361,
          "column": 93
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3362,
          "column": 3
        },
        "end": {
          "line": 3365,
          "column": 24
        }
      }
    ],
    "since": "1.0.0",
    "category": "Optional queries"
  }
}
