{
  "id": "@typed/fx/Fx#toStream",
  "canonicalId": "@typed/fx/Fx#toStream",
  "symbol": {
    "id": "@typed/fx/Fx#toStream",
    "packageName": "@typed/fx",
    "moduleName": "Fx",
    "exportName": "toStream",
    "kind": "constant",
    "signatures": [
      "export declare const toStream: <A, E, R>(fx: Fx.Fx<A, E, R>, options?: ToStreamOptions) => Stream.Stream<A, E, R>;"
    ],
    "summary": "Adapts a push-based `Fx` to an Effect `Stream`.",
    "sections": {
      "Why": "Existing Effect [Stream](https://effect.website/docs/v4/api/effect/Stream) consumers\ncan use an `Fx` without losing the producer's typed values, failures, or services.\nValues and causes cross a queue in emission order; the queue ends when the `Fx` run\ncompletes.",
      "Ownership and lifetime": "Conversion is lazy. Running the Stream allocates the callback queue and runs the\n`Fx`; the Stream's scope owns both. Interruption closes the callback subscription\nthrough Effect Stream's lifecycle. Buffering follows `options`."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Stream } from \"effect\"\nimport { fromIterable, toStream } from \"@typed/fx/Fx\"\n\nconst values = toStream(fromIterable([1, 2, 3]))\nconst total = Stream.runFold(values, () => 0, (sum, value) => sum + value)"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/stream.ts",
      "line": 57
    },
    "since": "1.0.0",
    "category": "Stream interop"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx/Fx#toStream",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.7",
    "moduleName": "Fx",
    "consumerSpecifier": "@typed/fx/Fx",
    "exportName": "toStream",
    "qualifiedName": "toStream",
    "declarationKey": "declaration:fff3ea7d8533886f0cdc2c75",
    "family": "variable",
    "signatures": [
      "export declare const toStream: <A, E, R>(fx: Fx.Fx<A, E, R>, options?: ToStreamOptions) => Stream.Stream<A, E, R>;"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/stream.ts",
        "start": {
          "line": 57,
          "column": 14
        },
        "end": {
          "line": 73,
          "column": 4
        }
      }
    ],
    "aliases": [
      "@typed/fx#Fx.toStream"
    ],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:fff3ea7d8533886f0cdc2c75",
    "name": "toStream",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const toStream: <A, E, R>(fx: Fx.Fx<A, E, R>, options?: ToStreamOptions) => Stream.Stream<A, E, R>;"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/stream.ts",
            "start": {
              "line": 57,
              "column": 14
            },
            "end": {
              "line": 73,
              "column": 4
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const toStream: <A, E, R>(fx: Fx.Fx<A, E, R>, options?: ToStreamOptions) => Stream.Stream<A, E, R>;"
    ],
    "typeParameters": [],
    "summary": "Adapts a push-based `Fx` to an Effect `Stream`.",
    "sections": {
      "Why": "Existing Effect [Stream](https://effect.website/docs/v4/api/effect/Stream) consumers\ncan use an `Fx` without losing the producer's typed values, failures, or services.\nValues and causes cross a queue in emission order; the queue ends when the `Fx` run\ncompletes.",
      "Ownership and lifetime": "Conversion is lazy. Running the Stream allocates the callback queue and runs the\n`Fx`; the Stream's scope owns both. Interruption closes the callback subscription\nthrough Effect Stream's lifecycle. Buffering follows `options`."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Stream } from \"effect\"\nimport { fromIterable, toStream } from \"@typed/fx/Fx\"\n\nconst values = toStream(fromIterable([1, 2, 3]))\nconst total = Stream.runFold(values, () => 0, (sum, value) => sum + value)"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/stream.ts",
        "start": {
          "line": 57,
          "column": 14
        },
        "end": {
          "line": 73,
          "column": 4
        }
      }
    ],
    "since": "1.0.0",
    "category": "Stream interop"
  }
}
