{
  "id": "@typed/fx#RefSubject.Filtered",
  "canonicalId": "@typed/fx/RefSubject#Filtered",
  "symbol": {
    "id": "@typed/fx#RefSubject.Filtered",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "RefSubject.Filtered",
    "kind": "interface",
    "signatures": [
      "export interface Filtered<out A, out E = never, out R = never> extends Versioned.Versioned<R, E, A, E, R | Scope.Scope, A, E | Cause.NoSuchElementError, R> {\n    readonly [FilteredTypeId]: FilteredTypeId;\n    asComputed(): Computed<Option.Option<A>, E, R>;\n}",
      "export declare namespace Filtered {\n    type Any = Filtered<any, any, any> | Filtered<never, any, any> | Filtered<any, never, any> | Filtered<never, never, any>;\n}"
    ],
    "summary": "A `Filtered` is a `Computed` that may not always have a value.\nIt is essentially a `Computed<Option<A>>` with helper methods.",
    "sections": {
      "Why": "Represents a derived value that may be absent now and become available on a later push,\npreserving absence in the state contract.",
      "Ownership and lifetime": "Filtered is a contract and performs no acquisition. Implementations retain the errors, services,\ninterruption, and Scope requirements expressed by its members.",
      "Property: [[computed:[FilteredTypeId]]]": "Carries the runtime marker distinguishing conditional Filtered state from Computed state.",
      "Property: [[computed:[FilteredTypeId]]]: Why": "Marks the value as Filtered for runtime guards and composition without changing its data or\nerror channels.",
      "Property: [[computed:[FilteredTypeId]]]: Ownership and lifetime": "This declaration performs no acquisition and retains no resources. Implementations preserve\nsource errors, services, and lifetime.",
      "Method: asComputed": "Converts the Filtered back to a Computed of Option.",
      "Method: asComputed: Why": "Converts the Filtered back to a Computed of Option. The result remains a lazy view rather than a\nduplicated mutable value.",
      "Method: asComputed: Ownership and lifetime": "The as computed view retains no independent state. Effectful reads sample the source once;\nFx observation follows later pushes and the observing Scope finalizes it."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect, Option } from \"effect\"\nimport { RefSubject } from \"@typed/fx\"\n\n// Create a RefSubject and filter it\nconst program = Effect.gen(function* () {\n  const numbers = yield* RefSubject.make([1, 2, 3, 4, 5])\n\n  // Get the first even number (filtered)\n  const firstEven = RefSubject.filterMap(\n    numbers,\n    (arr) => Option.fromNullable(arr.find((n) => n % 2 === 0))\n  )\n\n  // Try to get the value (may fail with NoSuchElementError)\n  const value = yield* firstEven\n  console.log(value) // 2\n\n  // Or convert back to Option\n  const option = firstEven.asComputed()\n  const maybeValue = yield* option\n  console.log(Option.isSome(maybeValue)) // true\n})"
      },
      {
        "language": "ts",
        "code": "import { Effect, Option } from \"effect\"\nimport * as RefSubject from \"@typed/fx/RefSubject\"\n\nconst program = Effect.gen(function* () {\n  const filtered = RefSubject.filterMap(\n    yield* RefSubject.make([1, 2, 3]),\n    (arr) => Option.fromNullable(arr.find((n) => n > 5))\n  )\n\n  // Convert to Computed<Option<number>>\n  const computed = filtered.asComputed()\n  const option = yield* computed\n  console.log(Option.isNone(option)) // true (no number > 5)\n})"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/RefSubject/RefSubject.ts",
      "line": 309
    },
    "since": "1.0.0",
    "category": "Read-only state"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#RefSubject.Filtered",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.13",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "RefSubject",
    "qualifiedName": "RefSubject.Filtered",
    "declarationKey": "declaration:f662ea50816efd6d23d0e3bd",
    "family": "interface",
    "signatures": [
      "export interface Filtered<out A, out E = never, out R = never> extends Versioned.Versioned<R, E, A, E, R | Scope.Scope, A, E | Cause.NoSuchElementError, R> {\n    readonly [FilteredTypeId]: FilteredTypeId;\n    asComputed(): Computed<Option.Option<A>, E, R>;\n}",
      "export declare namespace Filtered {\n    type Any = Filtered<any, any, any> | Filtered<never, any, any> | Filtered<any, never, any> | Filtered<never, never, any>;\n}"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 309,
          "column": 1
        },
        "end": {
          "line": 373,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 392,
          "column": 1
        },
        "end": {
          "line": 415,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 336,
          "column": 3
        },
        "end": {
          "line": 336,
          "column": 45
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 372,
          "column": 3
        },
        "end": {
          "line": 372,
          "column": 50
        }
      }
    ],
    "aliases": [
      "@typed/fx/RefSubject#Filtered"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#RefSubject",
    "static": false,
    "importedFrom": "declaration:f662ea50816efd6d23d0e3bd"
  },
  "declaration": {
    "declarationKey": "declaration:f662ea50816efd6d23d0e3bd",
    "name": "Filtered",
    "family": "interface",
    "facets": [
      {
        "family": "interface",
        "syntaxKind": "InterfaceDeclaration",
        "signatures": [
          "export interface Filtered<out A, out E = never, out R = never> extends Versioned.Versioned<R, E, A, E, R | Scope.Scope, A, E | Cause.NoSuchElementError, R> {\n    readonly [FilteredTypeId]: FilteredTypeId;\n    asComputed(): Computed<Option.Option<A>, E, R>;\n}"
        ],
        "typeParameters": [
          "out A",
          "out E = never",
          "out R = never"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 309,
              "column": 1
            },
            "end": {
              "line": 373,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "namespace",
        "syntaxKind": "ModuleDeclaration",
        "signatures": [
          "export declare namespace Filtered {\n    type Any = Filtered<any, any, any> | Filtered<never, any, any> | Filtered<any, never, any> | Filtered<never, never, any>;\n}"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 392,
              "column": 1
            },
            "end": {
              "line": 415,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "property",
        "syntaxKind": "PropertySignature",
        "signatures": [
          "readonly [FilteredTypeId]: FilteredTypeId;"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 336,
              "column": 3
            },
            "end": {
              "line": 336,
              "column": 45
            }
          }
        ],
        "static": false,
        "readonly": true,
        "optional": false
      },
      {
        "family": "method",
        "syntaxKind": "MethodSignature",
        "signatures": [
          "asComputed(): Computed<Option.Option<A>, E, R>;"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 372,
              "column": 3
            },
            "end": {
              "line": 372,
              "column": 50
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export interface Filtered<out A, out E = never, out R = never> extends Versioned.Versioned<R, E, A, E, R | Scope.Scope, A, E | Cause.NoSuchElementError, R> {\n    readonly [FilteredTypeId]: FilteredTypeId;\n    asComputed(): Computed<Option.Option<A>, E, R>;\n}",
      "export declare namespace Filtered {\n    type Any = Filtered<any, any, any> | Filtered<never, any, any> | Filtered<any, never, any> | Filtered<never, never, any>;\n}"
    ],
    "typeParameters": [
      "out A",
      "out E = never",
      "out R = never"
    ],
    "summary": "A `Filtered` is a `Computed` that may not always have a value.\nIt is essentially a `Computed<Option<A>>` with helper methods.",
    "sections": {
      "Why": "Represents a derived value that may be absent now and become available on a later push,\npreserving absence in the state contract.",
      "Ownership and lifetime": "Filtered is a contract and performs no acquisition. Implementations retain the errors, services,\ninterruption, and Scope requirements expressed by its members.",
      "Property: [[computed:[FilteredTypeId]]]": "Carries the runtime marker distinguishing conditional Filtered state from Computed state.",
      "Property: [[computed:[FilteredTypeId]]]: Why": "Marks the value as Filtered for runtime guards and composition without changing its data or\nerror channels.",
      "Property: [[computed:[FilteredTypeId]]]: Ownership and lifetime": "This declaration performs no acquisition and retains no resources. Implementations preserve\nsource errors, services, and lifetime.",
      "Method: asComputed": "Converts the Filtered back to a Computed of Option.",
      "Method: asComputed: Why": "Converts the Filtered back to a Computed of Option. The result remains a lazy view rather than a\nduplicated mutable value.",
      "Method: asComputed: Ownership and lifetime": "The as computed view retains no independent state. Effectful reads sample the source once;\nFx observation follows later pushes and the observing Scope finalizes it."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect, Option } from \"effect\"\nimport { RefSubject } from \"@typed/fx\"\n\n// Create a RefSubject and filter it\nconst program = Effect.gen(function* () {\n  const numbers = yield* RefSubject.make([1, 2, 3, 4, 5])\n\n  // Get the first even number (filtered)\n  const firstEven = RefSubject.filterMap(\n    numbers,\n    (arr) => Option.fromNullable(arr.find((n) => n % 2 === 0))\n  )\n\n  // Try to get the value (may fail with NoSuchElementError)\n  const value = yield* firstEven\n  console.log(value) // 2\n\n  // Or convert back to Option\n  const option = firstEven.asComputed()\n  const maybeValue = yield* option\n  console.log(Option.isSome(maybeValue)) // true\n})"
      },
      {
        "language": "ts",
        "code": "import { Effect, Option } from \"effect\"\nimport * as RefSubject from \"@typed/fx/RefSubject\"\n\nconst program = Effect.gen(function* () {\n  const filtered = RefSubject.filterMap(\n    yield* RefSubject.make([1, 2, 3]),\n    (arr) => Option.fromNullable(arr.find((n) => n > 5))\n  )\n\n  // Convert to Computed<Option<number>>\n  const computed = filtered.asComputed()\n  const option = yield* computed\n  console.log(Option.isNone(option)) // true (no number > 5)\n})"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 309,
          "column": 1
        },
        "end": {
          "line": 373,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 392,
          "column": 1
        },
        "end": {
          "line": 415,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 336,
          "column": 3
        },
        "end": {
          "line": 336,
          "column": 45
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 372,
          "column": 3
        },
        "end": {
          "line": 372,
          "column": 50
        }
      }
    ],
    "since": "1.0.0",
    "category": "Read-only state"
  }
}
