{
  "id": "@typed/fx#Fx.timeoutTo",
  "canonicalId": "@typed/fx/Fx#timeoutTo",
  "symbol": {
    "id": "@typed/fx#Fx.timeoutTo",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "Fx.timeoutTo",
    "kind": "constant",
    "signatures": [
      "export declare const timeoutTo: {\n    <B, E2, R2>(duration: Duration.Input, fallback: Fx<B, E2, R2>): <A, E, R>(self: Fx<A, E, R>) => Fx<A | B, E | E2, R | R2 | Scope.Scope>;\n    <A, E, R, B, E2, R2>(self: Fx<A, E, R>, duration: Duration.Input, fallback: Fx<B, E2, R2>): Fx<A | B, E | E2, R | R2 | Scope.Scope>;\n};"
    ],
    "summary": "Switches to `fallback` if the source does not produce a value within\n`duration` of the previous event. Matches Effect `Stream.timeoutOrElse`\nand RxJS `timeoutTo`.",
    "sections": {
      "Why": "A fallback lets an idle producer hand ownership to another push source while\npreserving both sources' precise values, failures, and services.",
      "Ownership and lifetime": "The source and resettable timer start first. On timeout the source is\ninterrupted, then one fallback subscription starts; the two producers never\noverlap. A source failure before timeout propagates and does not start the\nfallback. Interruption stops the active producer and timer. Infinite duration\nreturns the source unchanged; zero duration returns the fallback without\nstarting the source."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { timeoutTo } from \"@typed/fx/Fx\"\nimport { periodic, succeed } from \"@typed/fx/Fx\"\n\nconst available = timeoutTo(periodic(\"1 second\"), \"250 millis\", succeed(\"offline\"))"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/combinators/timeout.ts",
      "line": 130
    },
    "since": "1.0.0",
    "category": "Time and rate"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#Fx.timeoutTo",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.13",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "Fx",
    "qualifiedName": "Fx.timeoutTo",
    "declarationKey": "declaration:b42659ace0f624aaa6fc8660",
    "family": "variable",
    "signatures": [
      "export declare const timeoutTo: {\n    <B, E2, R2>(duration: Duration.Input, fallback: Fx<B, E2, R2>): <A, E, R>(self: Fx<A, E, R>) => Fx<A | B, E | E2, R | R2 | Scope.Scope>;\n    <A, E, R, B, E2, R2>(self: Fx<A, E, R>, duration: Duration.Input, fallback: Fx<B, E2, R2>): Fx<A | B, E | E2, R | R2 | Scope.Scope>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/timeout.ts",
        "start": {
          "line": 130,
          "column": 14
        },
        "end": {
          "line": 152,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/timeout.ts",
        "start": {
          "line": 131,
          "column": 3
        },
        "end": {
          "line": 134,
          "column": 78
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/timeout.ts",
        "start": {
          "line": 135,
          "column": 3
        },
        "end": {
          "line": 139,
          "column": 46
        }
      }
    ],
    "aliases": [
      "@typed/fx/Fx#timeoutTo"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#Fx",
    "static": false,
    "importedFrom": "declaration:b42659ace0f624aaa6fc8660"
  },
  "declaration": {
    "declarationKey": "declaration:b42659ace0f624aaa6fc8660",
    "name": "timeoutTo",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const timeoutTo: {\n    <B, E2, R2>(duration: Duration.Input, fallback: Fx<B, E2, R2>): <A, E, R>(self: Fx<A, E, R>) => Fx<A | B, E | E2, R | R2 | Scope.Scope>;\n    <A, E, R, B, E2, R2>(self: Fx<A, E, R>, duration: Duration.Input, fallback: Fx<B, E2, R2>): Fx<A | B, E | E2, R | R2 | Scope.Scope>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/timeout.ts",
            "start": {
              "line": 130,
              "column": 14
            },
            "end": {
              "line": 152,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<B, E2, R2>(duration: Duration.Input, fallback: Fx<B, E2, R2>): <A, E, R>(self: Fx<A, E, R>) => Fx<A | B, E | E2, R | R2 | Scope.Scope>;",
          "<A, E, R, B, E2, R2>(self: Fx<A, E, R>, duration: Duration.Input, fallback: Fx<B, E2, R2>): Fx<A | B, E | E2, R | R2 | Scope.Scope>;"
        ],
        "typeParameters": [
          "B",
          "E2",
          "R2",
          "A",
          "E",
          "R"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/timeout.ts",
            "start": {
              "line": 131,
              "column": 3
            },
            "end": {
              "line": 134,
              "column": 78
            }
          },
          {
            "file": "packages/fx/src/Fx/combinators/timeout.ts",
            "start": {
              "line": 135,
              "column": 3
            },
            "end": {
              "line": 139,
              "column": 46
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const timeoutTo: {\n    <B, E2, R2>(duration: Duration.Input, fallback: Fx<B, E2, R2>): <A, E, R>(self: Fx<A, E, R>) => Fx<A | B, E | E2, R | R2 | Scope.Scope>;\n    <A, E, R, B, E2, R2>(self: Fx<A, E, R>, duration: Duration.Input, fallback: Fx<B, E2, R2>): Fx<A | B, E | E2, R | R2 | Scope.Scope>;\n};"
    ],
    "typeParameters": [
      "B",
      "E2",
      "R2",
      "A",
      "E",
      "R"
    ],
    "summary": "Switches to `fallback` if the source does not produce a value within\n`duration` of the previous event. Matches Effect `Stream.timeoutOrElse`\nand RxJS `timeoutTo`.",
    "sections": {
      "Why": "A fallback lets an idle producer hand ownership to another push source while\npreserving both sources' precise values, failures, and services.",
      "Ownership and lifetime": "The source and resettable timer start first. On timeout the source is\ninterrupted, then one fallback subscription starts; the two producers never\noverlap. A source failure before timeout propagates and does not start the\nfallback. Interruption stops the active producer and timer. Infinite duration\nreturns the source unchanged; zero duration returns the fallback without\nstarting the source."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { timeoutTo } from \"@typed/fx/Fx\"\nimport { periodic, succeed } from \"@typed/fx/Fx\"\n\nconst available = timeoutTo(periodic(\"1 second\"), \"250 millis\", succeed(\"offline\"))"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/timeout.ts",
        "start": {
          "line": 130,
          "column": 14
        },
        "end": {
          "line": 152,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/timeout.ts",
        "start": {
          "line": 131,
          "column": 3
        },
        "end": {
          "line": 134,
          "column": 78
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/timeout.ts",
        "start": {
          "line": 135,
          "column": 3
        },
        "end": {
          "line": 139,
          "column": 46
        }
      }
    ],
    "since": "1.0.0",
    "category": "Time and rate"
  }
}
