{
  "id": "@typed/fx#Fx.sample",
  "canonicalId": "@typed/fx/Fx#sample",
  "symbol": {
    "id": "@typed/fx#Fx.sample",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "Fx.sample",
    "kind": "constant",
    "signatures": [
      "export declare const sample: {\n    <S, E2, R2>(sampler: Fx<S, E2, R2>): <A, E, R>(self: Fx<A, E, R>) => Fx<A, E | E2, R | R2>;\n    <A, E, R, S, E2, R2>(self: Fx<A, E, R>, sampler: Fx<S, E2, R2>): Fx<A, E | E2, R | R2>;\n};"
    ],
    "summary": "Emits the latest source value whenever `sampler` emits. Source values that\narrive between sampler ticks are not forwarded until the next tick.\n\n**Completion:** Completes when the source completes.\n**Errors:** The first failure from either stream fails the result.",
    "sections": {
      "Why": "`sample` separates value production from observation cadence. A sampler tick emits the latest\nsource value once, or nothing before the source's first value; repeated ticks may repeat a value.",
      "Ownership and lifetime": "One latest-value cell and a child sampler fiber belong to each run. Source completion interrupts\nthe sampler; any failure or consumer interruption stops both and releases the retained value."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Fx } from \"@typed/fx\"\nconst snapshots = Fx.sample(Fx.fromIterable([10, 20]), Fx.fromIterable([\"tick\"]))"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/combinators/sample.ts",
      "line": 35
    },
    "since": "1.0.0",
    "category": "Time and rate"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#Fx.sample",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.7",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "Fx",
    "qualifiedName": "Fx.sample",
    "declarationKey": "declaration:12a02597f832b8111d9b4723",
    "family": "variable",
    "signatures": [
      "export declare const sample: {\n    <S, E2, R2>(sampler: Fx<S, E2, R2>): <A, E, R>(self: Fx<A, E, R>) => Fx<A, E | E2, R | R2>;\n    <A, E, R, S, E2, R2>(self: Fx<A, E, R>, sampler: Fx<S, E2, R2>): Fx<A, E | E2, R | R2>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/sample.ts",
        "start": {
          "line": 35,
          "column": 14
        },
        "end": {
          "line": 62,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/sample.ts",
        "start": {
          "line": 36,
          "column": 3
        },
        "end": {
          "line": 36,
          "column": 94
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/sample.ts",
        "start": {
          "line": 37,
          "column": 3
        },
        "end": {
          "line": 37,
          "column": 90
        }
      }
    ],
    "aliases": [
      "@typed/fx/Fx#sample"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#Fx",
    "static": false,
    "importedFrom": "declaration:12a02597f832b8111d9b4723"
  },
  "declaration": {
    "declarationKey": "declaration:12a02597f832b8111d9b4723",
    "name": "sample",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const sample: {\n    <S, E2, R2>(sampler: Fx<S, E2, R2>): <A, E, R>(self: Fx<A, E, R>) => Fx<A, E | E2, R | R2>;\n    <A, E, R, S, E2, R2>(self: Fx<A, E, R>, sampler: Fx<S, E2, R2>): Fx<A, E | E2, R | R2>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/sample.ts",
            "start": {
              "line": 35,
              "column": 14
            },
            "end": {
              "line": 62,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<S, E2, R2>(sampler: Fx<S, E2, R2>): <A, E, R>(self: Fx<A, E, R>) => Fx<A, E | E2, R | R2>;",
          "<A, E, R, S, E2, R2>(self: Fx<A, E, R>, sampler: Fx<S, E2, R2>): Fx<A, E | E2, R | R2>;"
        ],
        "typeParameters": [
          "S",
          "E2",
          "R2",
          "A",
          "E",
          "R"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/sample.ts",
            "start": {
              "line": 36,
              "column": 3
            },
            "end": {
              "line": 36,
              "column": 94
            }
          },
          {
            "file": "packages/fx/src/Fx/combinators/sample.ts",
            "start": {
              "line": 37,
              "column": 3
            },
            "end": {
              "line": 37,
              "column": 90
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const sample: {\n    <S, E2, R2>(sampler: Fx<S, E2, R2>): <A, E, R>(self: Fx<A, E, R>) => Fx<A, E | E2, R | R2>;\n    <A, E, R, S, E2, R2>(self: Fx<A, E, R>, sampler: Fx<S, E2, R2>): Fx<A, E | E2, R | R2>;\n};"
    ],
    "typeParameters": [
      "S",
      "E2",
      "R2",
      "A",
      "E",
      "R"
    ],
    "summary": "Emits the latest source value whenever `sampler` emits. Source values that\narrive between sampler ticks are not forwarded until the next tick.\n\n**Completion:** Completes when the source completes.\n**Errors:** The first failure from either stream fails the result.",
    "sections": {
      "Why": "`sample` separates value production from observation cadence. A sampler tick emits the latest\nsource value once, or nothing before the source's first value; repeated ticks may repeat a value.",
      "Ownership and lifetime": "One latest-value cell and a child sampler fiber belong to each run. Source completion interrupts\nthe sampler; any failure or consumer interruption stops both and releases the retained value."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Fx } from \"@typed/fx\"\nconst snapshots = Fx.sample(Fx.fromIterable([10, 20]), Fx.fromIterable([\"tick\"]))"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/sample.ts",
        "start": {
          "line": 35,
          "column": 14
        },
        "end": {
          "line": 62,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/sample.ts",
        "start": {
          "line": 36,
          "column": 3
        },
        "end": {
          "line": 36,
          "column": 94
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/sample.ts",
        "start": {
          "line": 37,
          "column": 3
        },
        "end": {
          "line": 37,
          "column": 90
        }
      }
    ],
    "since": "1.0.0",
    "category": "Time and rate"
  }
}
