{
  "id": "@typed/fx#Fx.exhaustLatestMap",
  "canonicalId": "@typed/fx/Fx#exhaustLatestMap",
  "symbol": {
    "id": "@typed/fx#Fx.exhaustLatestMap",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "Fx.exhaustLatestMap",
    "kind": "constant",
    "signatures": [
      "export declare const exhaustLatestMap: FlatMapLike;"
    ],
    "summary": "Maps each element to an inner Fx, running one now and retaining only the latest waiting value.",
    "sections": {
      "Why": "`exhaustLatestMap` fits work that cannot overlap but must eventually reflect\nthe newest request. Unlike {@link exhaustMap }, it remembers one pending value;\nunlike {@link concatMap }, it does not let a backlog grow.",
      "Admission, buffering, and cardinality": "The first value while idle starts immediately. While that inner runs, each new\nvalue replaces the single pending inner Effect; replaced values never run.\nWhen the active inner completes, the latest pending inner starts. An admitted\ninner may emit any number of values, in that inner's order.",
      "Ownership and lifetime": "Source and admitted-inner failures are forwarded and both environments remain\ntyped. The required `Scope` owns every active inner fiber. Source completion\nwaits until the active and final pending inner finish; interruption closes the\nScope and runs inner finalizers. The one-slot pending buffer retains work, not\nemitted output."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Fx } from \"@typed/fx\"\nimport { Effect } from \"effect\"\n\nconst refreshes = Fx.mergeAll(\n  Fx.at(\"v1\", \"0 millis\"),\n  Fx.at(\"v2\", \"5 millis\"),\n  Fx.at(\"v3\", \"10 millis\")\n)\nconst latestEventually = Fx.exhaustLatestMap(refreshes, (version) =>\n  Fx.at(`indexed:${version}`, \"20 millis\")\n)\n\nEffect.runPromise(Effect.scoped(Fx.collectAll(latestEventually))).then(console.log)\n// [\"indexed:v1\", \"indexed:v3\"]"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/combinators/exhaustLatestMap.ts",
      "line": 59
    },
    "since": "1.0.0",
    "category": "Concurrent work"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#Fx.exhaustLatestMap",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.7",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "Fx",
    "qualifiedName": "Fx.exhaustLatestMap",
    "declarationKey": "declaration:de80b0b37e73587ff5d54282",
    "family": "variable",
    "signatures": [
      "export declare const exhaustLatestMap: FlatMapLike;"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/exhaustLatestMap.ts",
        "start": {
          "line": 59,
          "column": 14
        },
        "end": {
          "line": 110,
          "column": 2
        }
      }
    ],
    "aliases": [
      "@typed/fx/Fx#exhaustLatestMap"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#Fx",
    "static": false,
    "importedFrom": "declaration:de80b0b37e73587ff5d54282"
  },
  "declaration": {
    "declarationKey": "declaration:de80b0b37e73587ff5d54282",
    "name": "exhaustLatestMap",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const exhaustLatestMap: FlatMapLike;"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/exhaustLatestMap.ts",
            "start": {
              "line": 59,
              "column": 14
            },
            "end": {
              "line": 110,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const exhaustLatestMap: FlatMapLike;"
    ],
    "typeParameters": [],
    "summary": "Maps each element to an inner Fx, running one now and retaining only the latest waiting value.",
    "sections": {
      "Why": "`exhaustLatestMap` fits work that cannot overlap but must eventually reflect\nthe newest request. Unlike {@link exhaustMap }, it remembers one pending value;\nunlike {@link concatMap }, it does not let a backlog grow.",
      "Admission, buffering, and cardinality": "The first value while idle starts immediately. While that inner runs, each new\nvalue replaces the single pending inner Effect; replaced values never run.\nWhen the active inner completes, the latest pending inner starts. An admitted\ninner may emit any number of values, in that inner's order.",
      "Ownership and lifetime": "Source and admitted-inner failures are forwarded and both environments remain\ntyped. The required `Scope` owns every active inner fiber. Source completion\nwaits until the active and final pending inner finish; interruption closes the\nScope and runs inner finalizers. The one-slot pending buffer retains work, not\nemitted output."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Fx } from \"@typed/fx\"\nimport { Effect } from \"effect\"\n\nconst refreshes = Fx.mergeAll(\n  Fx.at(\"v1\", \"0 millis\"),\n  Fx.at(\"v2\", \"5 millis\"),\n  Fx.at(\"v3\", \"10 millis\")\n)\nconst latestEventually = Fx.exhaustLatestMap(refreshes, (version) =>\n  Fx.at(`indexed:${version}`, \"20 millis\")\n)\n\nEffect.runPromise(Effect.scoped(Fx.collectAll(latestEventually))).then(console.log)\n// [\"indexed:v1\", \"indexed:v3\"]"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/exhaustLatestMap.ts",
        "start": {
          "line": 59,
          "column": 14
        },
        "end": {
          "line": 110,
          "column": 2
        }
      }
    ],
    "since": "1.0.0",
    "category": "Concurrent work"
  }
}
