{
  "id": "@typed/fx/Fx#concatMap",
  "canonicalId": "@typed/fx/Fx#concatMap",
  "symbol": {
    "id": "@typed/fx/Fx#concatMap",
    "packageName": "@typed/fx",
    "moduleName": "Fx",
    "exportName": "concatMap",
    "kind": "constant",
    "signatures": [
      "export declare const concatMap: FlatMapLike;"
    ],
    "summary": "Maps each element to an inner Fx and concatenates the results sequentially.",
    "sections": {
      "Why": "`concatMap` is the flattening policy for work that must not overlap: the next\nsource value is admitted only after the current inner Fx completes. It is the\nbounded-concurrency form of {@link flatMapConcurrently } with a limit of one.",
      "Ordering and cardinality": "Every source value creates exactly one inner Fx. Inner values retain both\nsource order and their order within each inner Fx; no inner value is buffered\nbehind a later inner because later inners have not started yet.",
      "Ownership and lifetime": "Source and inner failures are forwarded to the output Sink, and both service\nrequirements remain in the returned type. The required `Scope` owns the\nadmitted inner fiber; interruption closes it and prevents queued source work\nfrom starting. No values are dropped, switched, or replayed."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Fx } from \"@typed/fx\"\nimport { Effect } from \"effect\"\n\nconst ordered = Fx.concatMap(Fx.fromIterable([\n  { id: \"first\", wait: \"20 millis\" as const },\n  { id: \"second\", wait: \"1 millis\" as const }\n]), ({ id, wait }) => Fx.at(id, wait))\n\nconst program = Effect.scoped(Fx.collectAll(ordered))\nEffect.runPromise(program).then(console.log)\n// [\"first\", \"second\"]: the one-millisecond inner is not started early"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/combinators/concatMap.ts",
      "line": 51
    },
    "since": "1.0.0",
    "category": "Concurrent work"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx/Fx#concatMap",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.7",
    "moduleName": "Fx",
    "consumerSpecifier": "@typed/fx/Fx",
    "exportName": "concatMap",
    "qualifiedName": "concatMap",
    "declarationKey": "declaration:628498a7112392c46f02383f",
    "family": "variable",
    "signatures": [
      "export declare const concatMap: FlatMapLike;"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/concatMap.ts",
        "start": {
          "line": 51,
          "column": 14
        },
        "end": {
          "line": 58,
          "column": 2
        }
      }
    ],
    "aliases": [
      "@typed/fx#Fx.concatMap"
    ],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:628498a7112392c46f02383f",
    "name": "concatMap",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const concatMap: FlatMapLike;"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/concatMap.ts",
            "start": {
              "line": 51,
              "column": 14
            },
            "end": {
              "line": 58,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const concatMap: FlatMapLike;"
    ],
    "typeParameters": [],
    "summary": "Maps each element to an inner Fx and concatenates the results sequentially.",
    "sections": {
      "Why": "`concatMap` is the flattening policy for work that must not overlap: the next\nsource value is admitted only after the current inner Fx completes. It is the\nbounded-concurrency form of {@link flatMapConcurrently } with a limit of one.",
      "Ordering and cardinality": "Every source value creates exactly one inner Fx. Inner values retain both\nsource order and their order within each inner Fx; no inner value is buffered\nbehind a later inner because later inners have not started yet.",
      "Ownership and lifetime": "Source and inner failures are forwarded to the output Sink, and both service\nrequirements remain in the returned type. The required `Scope` owns the\nadmitted inner fiber; interruption closes it and prevents queued source work\nfrom starting. No values are dropped, switched, or replayed."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Fx } from \"@typed/fx\"\nimport { Effect } from \"effect\"\n\nconst ordered = Fx.concatMap(Fx.fromIterable([\n  { id: \"first\", wait: \"20 millis\" as const },\n  { id: \"second\", wait: \"1 millis\" as const }\n]), ({ id, wait }) => Fx.at(id, wait))\n\nconst program = Effect.scoped(Fx.collectAll(ordered))\nEffect.runPromise(program).then(console.log)\n// [\"first\", \"second\"]: the one-millisecond inner is not started early"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/concatMap.ts",
        "start": {
          "line": 51,
          "column": 14
        },
        "end": {
          "line": 58,
          "column": 2
        }
      }
    ],
    "since": "1.0.0",
    "category": "Concurrent work"
  }
}
