{
  "id": "@typed/fx/Fx#flatMapEffect",
  "canonicalId": "@typed/fx/Fx#flatMapEffect",
  "symbol": {
    "id": "@typed/fx/Fx#flatMapEffect",
    "packageName": "@typed/fx",
    "moduleName": "Fx",
    "exportName": "flatMapEffect",
    "kind": "constant",
    "signatures": [
      "export declare const flatMapEffect: FlatMapEffectLike;"
    ],
    "summary": "Maps each element of an Fx to an Effect, and merges the results.",
    "sections": {
      "Why": "This is the Effect-producing form of {@link flatMap }. It admits independent\nEffects directly without callers manually applying `Fx.fromEffect`.",
      "Concurrency, ordering, and cardinality": "Every source value starts one Effect with unbounded concurrency. Each\nsuccessful Effect emits exactly one value. Results appear in completion order,\nnot source order, and no output buffer restores ordering.",
      "Ownership and lifetime": "Source and callback failures remain typed and callback services are unioned\nwith source services. The required `Scope` owns all running Effects; source\ncompletion waits for them, and interruption runs every Effect finalizer."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Fx } from \"@typed/fx\"\nimport { Effect } from \"effect\"\n\nconst loaded = Fx.flatMapEffect(Fx.fromIterable([\n  { id: \"slow\", wait: \"20 millis\" as const },\n  { id: \"fast\", wait: \"1 millis\" as const }\n]), ({ id, wait }) => Effect.as(Effect.sleep(wait), id))\n\nEffect.runPromise(Effect.scoped(Fx.collectAll(loaded))).then(console.log)\n// [\"fast\", \"slow\"]"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/combinators/flatMapEffect.ts",
      "line": 78
    },
    "since": "1.0.0",
    "category": "Concurrent work"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx/Fx#flatMapEffect",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.13",
    "moduleName": "Fx",
    "consumerSpecifier": "@typed/fx/Fx",
    "exportName": "flatMapEffect",
    "qualifiedName": "flatMapEffect",
    "declarationKey": "declaration:989c558903a32fe33032c2c4",
    "family": "variable",
    "signatures": [
      "export declare const flatMapEffect: FlatMapEffectLike;"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/flatMapEffect.ts",
        "start": {
          "line": 78,
          "column": 14
        },
        "end": {
          "line": 84,
          "column": 2
        }
      }
    ],
    "aliases": [
      "@typed/fx#Fx.flatMapEffect"
    ],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:989c558903a32fe33032c2c4",
    "name": "flatMapEffect",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const flatMapEffect: FlatMapEffectLike;"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/flatMapEffect.ts",
            "start": {
              "line": 78,
              "column": 14
            },
            "end": {
              "line": 84,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const flatMapEffect: FlatMapEffectLike;"
    ],
    "typeParameters": [],
    "summary": "Maps each element of an Fx to an Effect, and merges the results.",
    "sections": {
      "Why": "This is the Effect-producing form of {@link flatMap }. It admits independent\nEffects directly without callers manually applying `Fx.fromEffect`.",
      "Concurrency, ordering, and cardinality": "Every source value starts one Effect with unbounded concurrency. Each\nsuccessful Effect emits exactly one value. Results appear in completion order,\nnot source order, and no output buffer restores ordering.",
      "Ownership and lifetime": "Source and callback failures remain typed and callback services are unioned\nwith source services. The required `Scope` owns all running Effects; source\ncompletion waits for them, and interruption runs every Effect finalizer."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Fx } from \"@typed/fx\"\nimport { Effect } from \"effect\"\n\nconst loaded = Fx.flatMapEffect(Fx.fromIterable([\n  { id: \"slow\", wait: \"20 millis\" as const },\n  { id: \"fast\", wait: \"1 millis\" as const }\n]), ({ id, wait }) => Effect.as(Effect.sleep(wait), id))\n\nEffect.runPromise(Effect.scoped(Fx.collectAll(loaded))).then(console.log)\n// [\"fast\", \"slow\"]"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/flatMapEffect.ts",
        "start": {
          "line": 78,
          "column": 14
        },
        "end": {
          "line": 84,
          "column": 2
        }
      }
    ],
    "since": "1.0.0",
    "category": "Concurrent work"
  }
}
