{
  "id": "@typed/fx#Subject.replay",
  "canonicalId": "@typed/fx/Subject#replay",
  "symbol": {
    "id": "@typed/fx#Subject.replay",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "Subject.replay",
    "kind": "constant",
    "signatures": [
      "export declare const replay: {\n    (capacity: number): <A, E, R>(fx: Fx.Fx<A, E, R>) => Fx.Fx<A, E | Cause.IllegalArgumentError, R | Scope.Scope>;\n    <A, E, R>(fx: Fx.Fx<A, E, R>, capacity: number): Fx.Fx<A, E | Cause.IllegalArgumentError, R | Scope.Scope>;\n};"
    ],
    "summary": "Shares an `Fx` and replays up to the last `capacity` successes or failures to new subscribers.",
    "sections": {
      "Why": "`replay` makes retention an explicit caller-selected policy rather than an implicit property of\nevery shared stream. Capacity `0` is equivalent to multicast retention; capacity `1` has hold\nsemantics; larger values replay the retained window from oldest to newest.",
      "Errors and interruption": "A non-integer, negative, or larger-than-32-bit capacity produces an `Fx` that fails with\n`Cause.IllegalArgumentError` without starting the source. Valid buffers retain `Exit` values, so\ntyped failures keep their original causes and order. The last subscriber interrupts the source\nand clears the buffer; source services remain in the return type.",
      "Ownership and lifetime": "`Scope` owns each subscription and the final subscriber owns shutdown of the active source\nsession. Buffer memory belongs to that session and is cleared when it is interrupted.",
      "Join-during-publication behavior": "Each `Exit` enters the replay buffer before it enters the serialized publication queue. A\nsubscriber joining while an earlier publication is still draining can replay a later queued exit\nand then receive the same exit again when normal delivery reaches it. Replay guarantees retained\norder, not exactly-once delivery across a concurrent subscribe/publish race."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Fx } from \"@typed/fx\"\nimport * as Subject from \"@typed/fx/Subject\"\n\nconst recent = Fx.fromIterable([1, 2, 3]).pipe(Subject.replay(2))"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Subject/Subject.ts",
      "line": 690
    },
    "since": "1.0.0",
    "category": "Sharing sources"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#Subject.replay",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.7",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "Subject",
    "qualifiedName": "Subject.replay",
    "declarationKey": "declaration:25f3c445f9b1b6a35322bc4c",
    "family": "variable",
    "signatures": [
      "export declare const replay: {\n    (capacity: number): <A, E, R>(fx: Fx.Fx<A, E, R>) => Fx.Fx<A, E | Cause.IllegalArgumentError, R | Scope.Scope>;\n    <A, E, R>(fx: Fx.Fx<A, E, R>, capacity: number): Fx.Fx<A, E | Cause.IllegalArgumentError, R | Scope.Scope>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Subject/Subject.ts",
        "start": {
          "line": 690,
          "column": 14
        },
        "end": {
          "line": 707,
          "column": 3
        }
      },
      {
        "file": "packages/fx/src/Subject/Subject.ts",
        "start": {
          "line": 691,
          "column": 3
        },
        "end": {
          "line": 693,
          "column": 97
        }
      },
      {
        "file": "packages/fx/src/Subject/Subject.ts",
        "start": {
          "line": 694,
          "column": 3
        },
        "end": {
          "line": 697,
          "column": 64
        }
      }
    ],
    "aliases": [
      "@typed/fx/Subject#replay"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#Subject",
    "static": false,
    "importedFrom": "declaration:25f3c445f9b1b6a35322bc4c"
  },
  "declaration": {
    "declarationKey": "declaration:25f3c445f9b1b6a35322bc4c",
    "name": "replay",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const replay: {\n    (capacity: number): <A, E, R>(fx: Fx.Fx<A, E, R>) => Fx.Fx<A, E | Cause.IllegalArgumentError, R | Scope.Scope>;\n    <A, E, R>(fx: Fx.Fx<A, E, R>, capacity: number): Fx.Fx<A, E | Cause.IllegalArgumentError, R | Scope.Scope>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Subject/Subject.ts",
            "start": {
              "line": 690,
              "column": 14
            },
            "end": {
              "line": 707,
              "column": 3
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "(capacity: number): <A, E, R>(fx: Fx.Fx<A, E, R>) => Fx.Fx<A, E | Cause.IllegalArgumentError, R | Scope.Scope>;",
          "<A, E, R>(fx: Fx.Fx<A, E, R>, capacity: number): Fx.Fx<A, E | Cause.IllegalArgumentError, R | Scope.Scope>;"
        ],
        "typeParameters": [
          "A",
          "E",
          "R"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Subject/Subject.ts",
            "start": {
              "line": 691,
              "column": 3
            },
            "end": {
              "line": 693,
              "column": 97
            }
          },
          {
            "file": "packages/fx/src/Subject/Subject.ts",
            "start": {
              "line": 694,
              "column": 3
            },
            "end": {
              "line": 697,
              "column": 64
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const replay: {\n    (capacity: number): <A, E, R>(fx: Fx.Fx<A, E, R>) => Fx.Fx<A, E | Cause.IllegalArgumentError, R | Scope.Scope>;\n    <A, E, R>(fx: Fx.Fx<A, E, R>, capacity: number): Fx.Fx<A, E | Cause.IllegalArgumentError, R | Scope.Scope>;\n};"
    ],
    "typeParameters": [
      "A",
      "E",
      "R"
    ],
    "summary": "Shares an `Fx` and replays up to the last `capacity` successes or failures to new subscribers.",
    "sections": {
      "Why": "`replay` makes retention an explicit caller-selected policy rather than an implicit property of\nevery shared stream. Capacity `0` is equivalent to multicast retention; capacity `1` has hold\nsemantics; larger values replay the retained window from oldest to newest.",
      "Errors and interruption": "A non-integer, negative, or larger-than-32-bit capacity produces an `Fx` that fails with\n`Cause.IllegalArgumentError` without starting the source. Valid buffers retain `Exit` values, so\ntyped failures keep their original causes and order. The last subscriber interrupts the source\nand clears the buffer; source services remain in the return type.",
      "Ownership and lifetime": "`Scope` owns each subscription and the final subscriber owns shutdown of the active source\nsession. Buffer memory belongs to that session and is cleared when it is interrupted.",
      "Join-during-publication behavior": "Each `Exit` enters the replay buffer before it enters the serialized publication queue. A\nsubscriber joining while an earlier publication is still draining can replay a later queued exit\nand then receive the same exit again when normal delivery reaches it. Replay guarantees retained\norder, not exactly-once delivery across a concurrent subscribe/publish race."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Fx } from \"@typed/fx\"\nimport * as Subject from \"@typed/fx/Subject\"\n\nconst recent = Fx.fromIterable([1, 2, 3]).pipe(Subject.replay(2))"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Subject/Subject.ts",
        "start": {
          "line": 690,
          "column": 14
        },
        "end": {
          "line": 707,
          "column": 3
        }
      },
      {
        "file": "packages/fx/src/Subject/Subject.ts",
        "start": {
          "line": 691,
          "column": 3
        },
        "end": {
          "line": 693,
          "column": 97
        }
      },
      {
        "file": "packages/fx/src/Subject/Subject.ts",
        "start": {
          "line": 694,
          "column": 3
        },
        "end": {
          "line": 697,
          "column": 64
        }
      }
    ],
    "since": "1.0.0",
    "category": "Sharing sources"
  }
}
