{
  "id": "@typed/fx#Subject.make",
  "canonicalId": "@typed/fx/Subject#make",
  "symbol": {
    "id": "@typed/fx#Subject.make",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "Subject.make",
    "kind": "function",
    "signatures": [
      "export declare function make<A, E = never>(replay?: number): Effect.Effect<Subject<A, E>, Cause.IllegalArgumentError, Scope.Scope>;"
    ],
    "summary": "Acquires a `Subject` whose subscribers and replay state are released with the current `Scope`.",
    "sections": {
      "Why": "`make` places the imperative subject boundary under Effect's structured resource ownership, so\ncancellation and scope closure cannot leave subscriptions or retained values behind.",
      "Ownership and lifetime": "The effect allocates when executed, not when described. Its required `Scope` installs a finalizer\nthat runs `interrupt`, closing all subscriber scopes and clearing the replay buffer. Individual\nsubscriber scopes may still end earlier without affecting other subscribers.",
      "Errors": "Invalid capacities fail in the typed error channel with `Cause.IllegalArgumentError`; no subject\nis allocated. Once acquired, publication callbacks have no typed failure result; the subject's\n`E` parameter describes incoming Causes rather than publication acknowledgment errors.\nInterruption and defects remain distinct from that typed channel."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport * as Subject from \"@typed/fx/Subject\"\n\nconst program = Effect.gen(function* () {\n  const messages = yield* Subject.make<string>(1)\n  yield* messages.onSuccess(\"online\")\n  return yield* messages.subscriberCount\n}).pipe(Effect.scoped)"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Subject/Subject.ts",
      "line": 1441
    },
    "since": "1.0.0",
    "category": "Subject construction"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#Subject.make",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.13",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "Subject",
    "qualifiedName": "Subject.make",
    "declarationKey": "declaration:9a83575fee2a268cca4f3444",
    "family": "function",
    "signatures": [
      "export declare function make<A, E = never>(replay?: number): Effect.Effect<Subject<A, E>, Cause.IllegalArgumentError, Scope.Scope>;"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Subject/Subject.ts",
        "start": {
          "line": 1441,
          "column": 1
        },
        "end": {
          "line": 1452,
          "column": 2
        }
      }
    ],
    "aliases": [
      "@typed/fx/Subject#make"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#Subject",
    "static": false,
    "importedFrom": "declaration:9a83575fee2a268cca4f3444"
  },
  "declaration": {
    "declarationKey": "declaration:9a83575fee2a268cca4f3444",
    "name": "make",
    "family": "function",
    "facets": [
      {
        "family": "function",
        "syntaxKind": "FunctionDeclaration",
        "signatures": [
          "export declare function make<A, E = never>(replay?: number): Effect.Effect<Subject<A, E>, Cause.IllegalArgumentError, Scope.Scope>;"
        ],
        "typeParameters": [
          "A",
          "E = never"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Subject/Subject.ts",
            "start": {
              "line": 1441,
              "column": 1
            },
            "end": {
              "line": 1452,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare function make<A, E = never>(replay?: number): Effect.Effect<Subject<A, E>, Cause.IllegalArgumentError, Scope.Scope>;"
    ],
    "typeParameters": [
      "A",
      "E = never"
    ],
    "summary": "Acquires a `Subject` whose subscribers and replay state are released with the current `Scope`.",
    "sections": {
      "Why": "`make` places the imperative subject boundary under Effect's structured resource ownership, so\ncancellation and scope closure cannot leave subscriptions or retained values behind.",
      "Ownership and lifetime": "The effect allocates when executed, not when described. Its required `Scope` installs a finalizer\nthat runs `interrupt`, closing all subscriber scopes and clearing the replay buffer. Individual\nsubscriber scopes may still end earlier without affecting other subscribers.",
      "Errors": "Invalid capacities fail in the typed error channel with `Cause.IllegalArgumentError`; no subject\nis allocated. Once acquired, publication callbacks have no typed failure result; the subject's\n`E` parameter describes incoming Causes rather than publication acknowledgment errors.\nInterruption and defects remain distinct from that typed channel."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport * as Subject from \"@typed/fx/Subject\"\n\nconst program = Effect.gen(function* () {\n  const messages = yield* Subject.make<string>(1)\n  yield* messages.onSuccess(\"online\")\n  return yield* messages.subscriberCount\n}).pipe(Effect.scoped)"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Subject/Subject.ts",
        "start": {
          "line": 1441,
          "column": 1
        },
        "end": {
          "line": 1452,
          "column": 2
        }
      }
    ],
    "since": "1.0.0",
    "category": "Subject construction"
  }
}
