{
  "id": "@typed/fx/Sink#collect",
  "canonicalId": "@typed/fx/Sink#collect",
  "symbol": {
    "id": "@typed/fx/Sink#collect",
    "packageName": "@typed/fx",
    "moduleName": "Sink",
    "exportName": "collect",
    "kind": "function",
    "signatures": [
      "export declare function collect<A, E>(ref: Ref.Ref<ReadonlyArray<A>>): Sink<A, E, never>;"
    ],
    "summary": "Collects all values into an array. Pass a `Ref<ReadonlyArray<A>>` (e.g. `Ref.make([])`);\nafter running, read the result with `Ref.get(ref)`.",
    "sections": {
      "Why": "Collection remains an explicit consumer concern and the accumulated result can be read without\nchanging the producer.",
      "Ownership and lifetime": "The caller owns the Ref. Each success returns a lazy atomic `Ref.update` that allocates a new array.\nSerialized producers collect in callback-Effect execution order. Concurrent updates remain atomic,\nbut execution scheduling—not invocation order—determines array order. Failures are ignored."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect, Ref } from \"effect\"\nimport * as Sink from \"@typed/fx/Sink\"\nconst program = Effect.gen(function* () {\n  const values = yield* Ref.make<ReadonlyArray<number>>([])\n  return Sink.collect(values)\n})"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Sink/combinators.ts",
      "line": 1789
    },
    "since": "1.0.0",
    "category": "Collecting values"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx/Sink#collect",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.7",
    "moduleName": "Sink",
    "consumerSpecifier": "@typed/fx/Sink",
    "exportName": "collect",
    "qualifiedName": "collect",
    "declarationKey": "declaration:e2949bfa4584c75549200a19",
    "family": "function",
    "signatures": [
      "export declare function collect<A, E>(ref: Ref.Ref<ReadonlyArray<A>>): Sink<A, E, never>;"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Sink/combinators.ts",
        "start": {
          "line": 1789,
          "column": 1
        },
        "end": {
          "line": 1794,
          "column": 2
        }
      }
    ],
    "aliases": [
      "@typed/fx#Sink.collect"
    ],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:e2949bfa4584c75549200a19",
    "name": "collect",
    "family": "function",
    "facets": [
      {
        "family": "function",
        "syntaxKind": "FunctionDeclaration",
        "signatures": [
          "export declare function collect<A, E>(ref: Ref.Ref<ReadonlyArray<A>>): Sink<A, E, never>;"
        ],
        "typeParameters": [
          "A",
          "E"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Sink/combinators.ts",
            "start": {
              "line": 1789,
              "column": 1
            },
            "end": {
              "line": 1794,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare function collect<A, E>(ref: Ref.Ref<ReadonlyArray<A>>): Sink<A, E, never>;"
    ],
    "typeParameters": [
      "A",
      "E"
    ],
    "summary": "Collects all values into an array. Pass a `Ref<ReadonlyArray<A>>` (e.g. `Ref.make([])`);\nafter running, read the result with `Ref.get(ref)`.",
    "sections": {
      "Why": "Collection remains an explicit consumer concern and the accumulated result can be read without\nchanging the producer.",
      "Ownership and lifetime": "The caller owns the Ref. Each success returns a lazy atomic `Ref.update` that allocates a new array.\nSerialized producers collect in callback-Effect execution order. Concurrent updates remain atomic,\nbut execution scheduling—not invocation order—determines array order. Failures are ignored."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect, Ref } from \"effect\"\nimport * as Sink from \"@typed/fx/Sink\"\nconst program = Effect.gen(function* () {\n  const values = yield* Ref.make<ReadonlyArray<number>>([])\n  return Sink.collect(values)\n})"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Sink/combinators.ts",
        "start": {
          "line": 1789,
          "column": 1
        },
        "end": {
          "line": 1794,
          "column": 2
        }
      }
    ],
    "since": "1.0.0",
    "category": "Collecting values"
  }
}
