{
  "id": "@typed/fx#RefSubject.compact",
  "canonicalId": "@typed/fx/RefSubject#compact",
  "symbol": {
    "id": "@typed/fx#RefSubject.compact",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "RefSubject.compact",
    "kind": "constant",
    "signatures": [
      "export declare const compact: {\n    <A, E, R>(ref: Computed<Option.Option<A>, E, R>): Filtered<A, E, R>;\n    <A, E, R>(ref: Filtered<Option.Option<A>, E, R>): Filtered<A, E, R>;\n    <R0, E0, A, E, R, E2, R2>(versioned: Versioned.Versioned<R0, E0, Option.Option<A>, E, R, Option.Option<A>, E2, R2>): Filtered<A, E0 | E | Exclude<E, Cause.NoSuchElementError> | Exclude<E2, Cause.NoSuchElementError>, R0 | R2 | Exclude<R, Scope.Scope>>;\n};"
    ],
    "summary": "Converts a `Computed` or `Filtered` of `Option<A>` into a `Filtered<A>`, filtering out `None` values.",
    "sections": {
      "Why": "Converts a `Computed` or `Filtered` of `Option<A>` into a `Filtered<A>`, filtering out `None`\nvalues. Current reads and pushed versions use the same derivation, preventing snapshot and\nsubscription behavior from diverging.",
      "Ownership and lifetime": "The compact view retains no independent value. Its Effect read fails with NoSuchElement\nwhile absent; the observing Scope owns and finalizes its Fx subscription."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect, Option } from \"effect\"\nimport * as RefSubject from \"@typed/fx/RefSubject\"\n\nconst program = Effect.gen(function* () {\n  const maybeValue = yield* RefSubject.make(Option.some(42))\n\n  // Compact the Option\n  const filtered = RefSubject.compact(maybeValue)\n\n  const value = yield* filtered\n  console.log(value) // 42\n\n  // If the Option becomes None, the Filtered will fail\n  yield* RefSubject.set(maybeValue, Option.none())\n  // yield* filtered would fail with NoSuchElementError\n})"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/RefSubject/RefSubject.ts",
      "line": 3299
    },
    "since": "1.0.0",
    "category": "Optional queries"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#RefSubject.compact",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.7",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "RefSubject",
    "qualifiedName": "RefSubject.compact",
    "declarationKey": "declaration:f12aa4d2eb8650c2e9abe182",
    "family": "variable",
    "signatures": [
      "export declare const compact: {\n    <A, E, R>(ref: Computed<Option.Option<A>, E, R>): Filtered<A, E, R>;\n    <A, E, R>(ref: Filtered<Option.Option<A>, E, R>): Filtered<A, E, R>;\n    <R0, E0, A, E, R, E2, R2>(versioned: Versioned.Versioned<R0, E0, Option.Option<A>, E, R, Option.Option<A>, E2, R2>): Filtered<A, E0 | E | Exclude<E, Cause.NoSuchElementError> | Exclude<E2, Cause.NoSuchElementError>, R0 | R2 | Exclude<R, Scope.Scope>>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3299,
          "column": 14
        },
        "end": {
          "line": 3314,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3300,
          "column": 3
        },
        "end": {
          "line": 3300,
          "column": 71
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3301,
          "column": 3
        },
        "end": {
          "line": 3301,
          "column": 71
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3303,
          "column": 3
        },
        "end": {
          "line": 3309,
          "column": 5
        }
      }
    ],
    "aliases": [
      "@typed/fx/RefSubject#compact"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#RefSubject",
    "static": false,
    "importedFrom": "declaration:f12aa4d2eb8650c2e9abe182"
  },
  "declaration": {
    "declarationKey": "declaration:f12aa4d2eb8650c2e9abe182",
    "name": "compact",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const compact: {\n    <A, E, R>(ref: Computed<Option.Option<A>, E, R>): Filtered<A, E, R>;\n    <A, E, R>(ref: Filtered<Option.Option<A>, E, R>): Filtered<A, E, R>;\n    <R0, E0, A, E, R, E2, R2>(versioned: Versioned.Versioned<R0, E0, Option.Option<A>, E, R, Option.Option<A>, E2, R2>): Filtered<A, E0 | E | Exclude<E, Cause.NoSuchElementError> | Exclude<E2, Cause.NoSuchElementError>, R0 | R2 | Exclude<R, Scope.Scope>>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 3299,
              "column": 14
            },
            "end": {
              "line": 3314,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<A, E, R>(ref: Computed<Option.Option<A>, E, R>): Filtered<A, E, R>;",
          "<A, E, R>(ref: Filtered<Option.Option<A>, E, R>): Filtered<A, E, R>;",
          "<R0, E0, A, E, R, E2, R2>(versioned: Versioned.Versioned<R0, E0, Option.Option<A>, E, R, Option.Option<A>, E2, R2>): Filtered<A, E0 | E | Exclude<E, Cause.NoSuchElementError> | Exclude<E2, Cause.NoSuchElementError>, R0 | R2 | Exclude<R, Scope.Scope>>;"
        ],
        "typeParameters": [
          "A",
          "E",
          "R",
          "R0",
          "E0",
          "E2",
          "R2"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 3300,
              "column": 3
            },
            "end": {
              "line": 3300,
              "column": 71
            }
          },
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 3301,
              "column": 3
            },
            "end": {
              "line": 3301,
              "column": 71
            }
          },
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 3303,
              "column": 3
            },
            "end": {
              "line": 3309,
              "column": 5
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const compact: {\n    <A, E, R>(ref: Computed<Option.Option<A>, E, R>): Filtered<A, E, R>;\n    <A, E, R>(ref: Filtered<Option.Option<A>, E, R>): Filtered<A, E, R>;\n    <R0, E0, A, E, R, E2, R2>(versioned: Versioned.Versioned<R0, E0, Option.Option<A>, E, R, Option.Option<A>, E2, R2>): Filtered<A, E0 | E | Exclude<E, Cause.NoSuchElementError> | Exclude<E2, Cause.NoSuchElementError>, R0 | R2 | Exclude<R, Scope.Scope>>;\n};"
    ],
    "typeParameters": [
      "A",
      "E",
      "R",
      "R0",
      "E0",
      "E2",
      "R2"
    ],
    "summary": "Converts a `Computed` or `Filtered` of `Option<A>` into a `Filtered<A>`, filtering out `None` values.",
    "sections": {
      "Why": "Converts a `Computed` or `Filtered` of `Option<A>` into a `Filtered<A>`, filtering out `None`\nvalues. Current reads and pushed versions use the same derivation, preventing snapshot and\nsubscription behavior from diverging.",
      "Ownership and lifetime": "The compact view retains no independent value. Its Effect read fails with NoSuchElement\nwhile absent; the observing Scope owns and finalizes its Fx subscription."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect, Option } from \"effect\"\nimport * as RefSubject from \"@typed/fx/RefSubject\"\n\nconst program = Effect.gen(function* () {\n  const maybeValue = yield* RefSubject.make(Option.some(42))\n\n  // Compact the Option\n  const filtered = RefSubject.compact(maybeValue)\n\n  const value = yield* filtered\n  console.log(value) // 42\n\n  // If the Option becomes None, the Filtered will fail\n  yield* RefSubject.set(maybeValue, Option.none())\n  // yield* filtered would fail with NoSuchElementError\n})"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3299,
          "column": 14
        },
        "end": {
          "line": 3314,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3300,
          "column": 3
        },
        "end": {
          "line": 3300,
          "column": 71
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3301,
          "column": 3
        },
        "end": {
          "line": 3301,
          "column": 71
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 3303,
          "column": 3
        },
        "end": {
          "line": 3309,
          "column": 5
        }
      }
    ],
    "since": "1.0.0",
    "category": "Optional queries"
  }
}
