{
  "id": "@typed/fx#Sink.last",
  "canonicalId": "@typed/fx/Sink#last",
  "symbol": {
    "id": "@typed/fx#Sink.last",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "Sink.last",
    "kind": "function",
    "signatures": [
      "export declare function last<A, E>(ref: Ref.Ref<Option.Option<A>>): Sink<A, E, never>;"
    ],
    "summary": "Keeps only the last value. Pass a `Ref<Option.Option<A>>` (e.g. `Ref.make(Option.none())`);\nafter running, read the result with `Ref.get(ref)`.",
    "sections": {
      "Why": "The latest observed value can be retained independently of producer completion.",
      "Ownership and lifetime": "The caller owns the Ref. Each success returns a lazy atomic `Ref.set`. With serialized callback\nEffects the last callback wins; with concurrent execution the last set to execute wins, which may\ndiffer from invocation order. Failures are ignored and the sink acquires no resources."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect, Option, Ref } from \"effect\"\nimport * as Sink from \"@typed/fx/Sink\"\nconst program = Effect.gen(function* () {\n  const latest = yield* Ref.make<Option.Option<number>>(Option.none())\n  return Sink.last(latest)\n})"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Sink/combinators.ts",
      "line": 1855
    },
    "since": "1.0.0",
    "category": "Collecting values"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#Sink.last",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.7",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "Sink",
    "qualifiedName": "Sink.last",
    "declarationKey": "declaration:b5a299704ef293b01f3e635e",
    "family": "function",
    "signatures": [
      "export declare function last<A, E>(ref: Ref.Ref<Option.Option<A>>): Sink<A, E, never>;"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Sink/combinators.ts",
        "start": {
          "line": 1855,
          "column": 1
        },
        "end": {
          "line": 1860,
          "column": 2
        }
      }
    ],
    "aliases": [
      "@typed/fx/Sink#last"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#Sink",
    "static": false,
    "importedFrom": "declaration:b5a299704ef293b01f3e635e"
  },
  "declaration": {
    "declarationKey": "declaration:b5a299704ef293b01f3e635e",
    "name": "last",
    "family": "function",
    "facets": [
      {
        "family": "function",
        "syntaxKind": "FunctionDeclaration",
        "signatures": [
          "export declare function last<A, E>(ref: Ref.Ref<Option.Option<A>>): Sink<A, E, never>;"
        ],
        "typeParameters": [
          "A",
          "E"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Sink/combinators.ts",
            "start": {
              "line": 1855,
              "column": 1
            },
            "end": {
              "line": 1860,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare function last<A, E>(ref: Ref.Ref<Option.Option<A>>): Sink<A, E, never>;"
    ],
    "typeParameters": [
      "A",
      "E"
    ],
    "summary": "Keeps only the last value. Pass a `Ref<Option.Option<A>>` (e.g. `Ref.make(Option.none())`);\nafter running, read the result with `Ref.get(ref)`.",
    "sections": {
      "Why": "The latest observed value can be retained independently of producer completion.",
      "Ownership and lifetime": "The caller owns the Ref. Each success returns a lazy atomic `Ref.set`. With serialized callback\nEffects the last callback wins; with concurrent execution the last set to execute wins, which may\ndiffer from invocation order. Failures are ignored and the sink acquires no resources."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect, Option, Ref } from \"effect\"\nimport * as Sink from \"@typed/fx/Sink\"\nconst program = Effect.gen(function* () {\n  const latest = yield* Ref.make<Option.Option<number>>(Option.none())\n  return Sink.last(latest)\n})"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Sink/combinators.ts",
        "start": {
          "line": 1855,
          "column": 1
        },
        "end": {
          "line": 1860,
          "column": 2
        }
      }
    ],
    "since": "1.0.0",
    "category": "Collecting values"
  }
}
