{
  "id": "@typed/fx#Push.filterInput",
  "canonicalId": "@typed/fx/Push#filterInput",
  "symbol": {
    "id": "@typed/fx#Push.filterInput",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "Push.filterInput",
    "kind": "constant",
    "signatures": [
      "export declare const filterInput: {\n    <A>(f: (a: A) => boolean): <E, R, B, E2, R2>(push: Push<A, E, R, B, E2, R2>) => Push<A, E, R, B, E2, R2>;\n    <A, E, R, B, E2, R2>(push: Push<A, E, R, B, E2, R2>, f: (a: A) => boolean): Push<A, E, R, B, E2, R2>;\n};"
    ],
    "summary": "Keeps successful inputs that satisfy `f` and discards the rest.\n\nCalling `onSuccess` runs the predicate immediately. A match constructs one Sink\ncallback Effect; a non-match immediately returns an empty acknowledgment.\nPredicate allocation and throws therefore occur before the returned Effect is\nrun. The producer controls call order and concurrency; output is preserved.",
    "sections": {
      "Why": "Filtering before the consumer avoids teaching the underlying Sink about input\nvalues that are irrelevant to it.",
      "Ownership and lifetime": "The predicate is synchronous at `onSuccess` invocation and acquires no\nresources. Accepted callback Effects retain the original Sink's errors,\nservices, interruption, and cleanup."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport * as Fx from \"@typed/fx/Fx\"\nimport * as Push from \"@typed/fx/Push\"\nimport * as Sink from \"@typed/fx/Sink\"\n\nconst checks: Array<number> = []\nconst positives = Push.filterInput(\n  Push.make(Sink.make(() => Effect.void, (n: number) => Effect.log(n)), Fx.empty),\n  (n) => (checks.push(n), n > 0)\n)\nconst acknowledgement = positives.onSuccess(-1)\n// checks is already [-1]; acknowledgement performs no Sink callback."
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Push/Push.ts",
      "line": 558
    },
    "since": "1.0.0",
    "category": "Selecting inputs"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#Push.filterInput",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.7",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "Push",
    "qualifiedName": "Push.filterInput",
    "declarationKey": "declaration:88002f6e8a4fb64041a272ae",
    "family": "variable",
    "signatures": [
      "export declare const filterInput: {\n    <A>(f: (a: A) => boolean): <E, R, B, E2, R2>(push: Push<A, E, R, B, E2, R2>) => Push<A, E, R, B, E2, R2>;\n    <A, E, R, B, E2, R2>(push: Push<A, E, R, B, E2, R2>, f: (a: A) => boolean): Push<A, E, R, B, E2, R2>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Push/Push.ts",
        "start": {
          "line": 558,
          "column": 14
        },
        "end": {
          "line": 575,
          "column": 3
        }
      },
      {
        "file": "packages/fx/src/Push/Push.ts",
        "start": {
          "line": 559,
          "column": 3
        },
        "end": {
          "line": 561,
          "column": 84
        }
      },
      {
        "file": "packages/fx/src/Push/Push.ts",
        "start": {
          "line": 562,
          "column": 3
        },
        "end": {
          "line": 565,
          "column": 31
        }
      }
    ],
    "aliases": [
      "@typed/fx/Push#filterInput"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#Push",
    "static": false,
    "importedFrom": "declaration:88002f6e8a4fb64041a272ae"
  },
  "declaration": {
    "declarationKey": "declaration:88002f6e8a4fb64041a272ae",
    "name": "filterInput",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const filterInput: {\n    <A>(f: (a: A) => boolean): <E, R, B, E2, R2>(push: Push<A, E, R, B, E2, R2>) => Push<A, E, R, B, E2, R2>;\n    <A, E, R, B, E2, R2>(push: Push<A, E, R, B, E2, R2>, f: (a: A) => boolean): Push<A, E, R, B, E2, R2>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Push/Push.ts",
            "start": {
              "line": 558,
              "column": 14
            },
            "end": {
              "line": 575,
              "column": 3
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<A>(f: (a: A) => boolean): <E, R, B, E2, R2>(push: Push<A, E, R, B, E2, R2>) => Push<A, E, R, B, E2, R2>;",
          "<A, E, R, B, E2, R2>(push: Push<A, E, R, B, E2, R2>, f: (a: A) => boolean): Push<A, E, R, B, E2, R2>;"
        ],
        "typeParameters": [
          "A",
          "E",
          "R",
          "B",
          "E2",
          "R2"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Push/Push.ts",
            "start": {
              "line": 559,
              "column": 3
            },
            "end": {
              "line": 561,
              "column": 84
            }
          },
          {
            "file": "packages/fx/src/Push/Push.ts",
            "start": {
              "line": 562,
              "column": 3
            },
            "end": {
              "line": 565,
              "column": 31
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const filterInput: {\n    <A>(f: (a: A) => boolean): <E, R, B, E2, R2>(push: Push<A, E, R, B, E2, R2>) => Push<A, E, R, B, E2, R2>;\n    <A, E, R, B, E2, R2>(push: Push<A, E, R, B, E2, R2>, f: (a: A) => boolean): Push<A, E, R, B, E2, R2>;\n};"
    ],
    "typeParameters": [
      "A",
      "E",
      "R",
      "B",
      "E2",
      "R2"
    ],
    "summary": "Keeps successful inputs that satisfy `f` and discards the rest.\n\nCalling `onSuccess` runs the predicate immediately. A match constructs one Sink\ncallback Effect; a non-match immediately returns an empty acknowledgment.\nPredicate allocation and throws therefore occur before the returned Effect is\nrun. The producer controls call order and concurrency; output is preserved.",
    "sections": {
      "Why": "Filtering before the consumer avoids teaching the underlying Sink about input\nvalues that are irrelevant to it.",
      "Ownership and lifetime": "The predicate is synchronous at `onSuccess` invocation and acquires no\nresources. Accepted callback Effects retain the original Sink's errors,\nservices, interruption, and cleanup."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport * as Fx from \"@typed/fx/Fx\"\nimport * as Push from \"@typed/fx/Push\"\nimport * as Sink from \"@typed/fx/Sink\"\n\nconst checks: Array<number> = []\nconst positives = Push.filterInput(\n  Push.make(Sink.make(() => Effect.void, (n: number) => Effect.log(n)), Fx.empty),\n  (n) => (checks.push(n), n > 0)\n)\nconst acknowledgement = positives.onSuccess(-1)\n// checks is already [-1]; acknowledgement performs no Sink callback."
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Push/Push.ts",
        "start": {
          "line": 558,
          "column": 14
        },
        "end": {
          "line": 575,
          "column": 3
        }
      },
      {
        "file": "packages/fx/src/Push/Push.ts",
        "start": {
          "line": 559,
          "column": 3
        },
        "end": {
          "line": 561,
          "column": 84
        }
      },
      {
        "file": "packages/fx/src/Push/Push.ts",
        "start": {
          "line": 562,
          "column": 3
        },
        "end": {
          "line": 565,
          "column": 31
        }
      }
    ],
    "since": "1.0.0",
    "category": "Selecting inputs"
  }
}
