{
  "id": "@typed/fx#RefSubject.make",
  "canonicalId": "@typed/fx/RefSubject#make",
  "symbol": {
    "id": "@typed/fx#RefSubject.make",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "RefSubject.make",
    "kind": "function",
    "signatures": [
      "export declare function make<A, E = never, R = never>(effect: A | Effect.Effect<A, E, R> | Stream.Stream<A, E, R> | Fx<A, E, R>, options?: RefSubjectOptions<A>): Effect.Effect<RefSubject<A, E>, never, R | Scope.Scope>;"
    ],
    "summary": "Creates a new `RefSubject` from a value, `Effect`, or `Fx`.",
    "sections": {
      "Why": "`RefSubject` keeps current state and pushed changes independent of any UI\nrenderer. Domain transitions can therefore be constructed, composed, and\ntested with Effect alone; rendering is one optional consumer of the state.\nPlain values, Effect programs, pull-based Effect `Stream`s, and push-based\n`Fx` sources all enter through the same state boundary.",
      "Ownership and lifetime": "Creation requires an Effect `Scope`. That scope owns source acquisition,\nsubscriptions, and finalization. The returned `RefSubject` exposes the\nsource error type when read or observed, while construction itself cannot\nfail. Closing the scope interrupts a live source and releases its resources.",
      "Initialization": "Calling `make` is lazy because it returns an Effect: nothing is allocated and no source runs\nuntil that creation Effect is executed. After creation, a plain value is immediately available.\nAn Effect input runs once on the first current read or observation. Fx and Stream inputs instead\nstart one shared source run when the creation Effect executes; reads wait for their first value\nor failure and later emissions replace the retained current state. Equality and buffering\nbehavior can be customized with `RefSubjectOptions`."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport * as RefSubject from \"@typed/fx/RefSubject\"\nimport { Fx } from \"@typed/fx\"\n\n// From a plain value\nconst program1 = Effect.gen(function* () {\n  const ref = yield* RefSubject.make(42)\n  const value = yield* ref\n  console.log(value) // 42\n})\n\n// From an Effect\nconst program2 = Effect.gen(function* () {\n  const ref = yield* RefSubject.make(\n    Effect.succeed(\"Hello\")\n  )\n  const value = yield* ref\n  console.log(value) // \"Hello\"\n})\n\n// From an Fx (tracks the latest value)\nconst program3 = Effect.gen(function* () {\n  const ref = yield* RefSubject.make(\n    Fx.fromIterable([1, 2, 3])\n  )\n  const value = yield* ref\n  console.log(value) // 3 (latest value)\n})"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/RefSubject/RefSubject.ts",
      "line": 1639
    },
    "since": "1.0.0",
    "category": "Constructors"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#RefSubject.make",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.7",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "RefSubject",
    "qualifiedName": "RefSubject.make",
    "declarationKey": "declaration:77da8f5d1bde4c7cfc20aaf8",
    "family": "function",
    "signatures": [
      "export declare function make<A, E = never, R = never>(effect: A | Effect.Effect<A, E, R> | Stream.Stream<A, E, R> | Fx<A, E, R>, options?: RefSubjectOptions<A>): Effect.Effect<RefSubject<A, E>, never, R | Scope.Scope>;"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 1639,
          "column": 1
        },
        "end": {
          "line": 1652,
          "column": 2
        }
      }
    ],
    "aliases": [
      "@typed/fx/RefSubject#make"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#RefSubject",
    "static": false,
    "importedFrom": "declaration:77da8f5d1bde4c7cfc20aaf8"
  },
  "declaration": {
    "declarationKey": "declaration:77da8f5d1bde4c7cfc20aaf8",
    "name": "make",
    "family": "function",
    "facets": [
      {
        "family": "function",
        "syntaxKind": "FunctionDeclaration",
        "signatures": [
          "export declare function make<A, E = never, R = never>(effect: A | Effect.Effect<A, E, R> | Stream.Stream<A, E, R> | Fx<A, E, R>, options?: RefSubjectOptions<A>): Effect.Effect<RefSubject<A, E>, never, R | Scope.Scope>;"
        ],
        "typeParameters": [
          "A",
          "E = never",
          "R = never"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 1639,
              "column": 1
            },
            "end": {
              "line": 1652,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare function make<A, E = never, R = never>(effect: A | Effect.Effect<A, E, R> | Stream.Stream<A, E, R> | Fx<A, E, R>, options?: RefSubjectOptions<A>): Effect.Effect<RefSubject<A, E>, never, R | Scope.Scope>;"
    ],
    "typeParameters": [
      "A",
      "E = never",
      "R = never"
    ],
    "summary": "Creates a new `RefSubject` from a value, `Effect`, or `Fx`.",
    "sections": {
      "Why": "`RefSubject` keeps current state and pushed changes independent of any UI\nrenderer. Domain transitions can therefore be constructed, composed, and\ntested with Effect alone; rendering is one optional consumer of the state.\nPlain values, Effect programs, pull-based Effect `Stream`s, and push-based\n`Fx` sources all enter through the same state boundary.",
      "Ownership and lifetime": "Creation requires an Effect `Scope`. That scope owns source acquisition,\nsubscriptions, and finalization. The returned `RefSubject` exposes the\nsource error type when read or observed, while construction itself cannot\nfail. Closing the scope interrupts a live source and releases its resources.",
      "Initialization": "Calling `make` is lazy because it returns an Effect: nothing is allocated and no source runs\nuntil that creation Effect is executed. After creation, a plain value is immediately available.\nAn Effect input runs once on the first current read or observation. Fx and Stream inputs instead\nstart one shared source run when the creation Effect executes; reads wait for their first value\nor failure and later emissions replace the retained current state. Equality and buffering\nbehavior can be customized with `RefSubjectOptions`."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport * as RefSubject from \"@typed/fx/RefSubject\"\nimport { Fx } from \"@typed/fx\"\n\n// From a plain value\nconst program1 = Effect.gen(function* () {\n  const ref = yield* RefSubject.make(42)\n  const value = yield* ref\n  console.log(value) // 42\n})\n\n// From an Effect\nconst program2 = Effect.gen(function* () {\n  const ref = yield* RefSubject.make(\n    Effect.succeed(\"Hello\")\n  )\n  const value = yield* ref\n  console.log(value) // \"Hello\"\n})\n\n// From an Fx (tracks the latest value)\nconst program3 = Effect.gen(function* () {\n  const ref = yield* RefSubject.make(\n    Fx.fromIterable([1, 2, 3])\n  )\n  const value = yield* ref\n  console.log(value) // 3 (latest value)\n})"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 1639,
          "column": 1
        },
        "end": {
          "line": 1652,
          "column": 2
        }
      }
    ],
    "since": "1.0.0",
    "category": "Constructors"
  }
}
