{
  "id": "@typed/fx#RefSubject.scan",
  "canonicalId": "@typed/fx/RefSubject#scan",
  "symbol": {
    "id": "@typed/fx#RefSubject.scan",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "RefSubject.scan",
    "kind": "constant",
    "signatures": [
      "export declare const scan: {\n    <S, A>(initial: S, f: (s: S, a: A) => S): <E, R>(ref: RefSubject<A, E, R> | Computed<A, E, R>) => Computed<S, E, R>;\n    <A, E, R, S>(ref: RefSubject<A, E, R> | Computed<A, E, R>, initial: S, f: (s: S, a: A) => S): Computed<S, E, R>;\n    <R0, E0, A, E, R, E2, R2, S>(versioned: Versioned.Versioned<R0, E0, A, E, R, A, E2, R2>, initial: S, f: (s: S, a: A) => S): Computed<S, E0 | E | E2, R0 | R2 | Exclude<R, Scope.Scope>>;\n};"
    ],
    "summary": "Stateful scan over a `RefSubject` / `Computed`, producing a `Computed` of the accumulated state.\n\nFx subscriptions follow `Fx.scan` semantics (emit `initial`, then fold each source value).\nEffect sampling accumulates across source versions via a private state ref (do not mix heavy\nsubscribe + sample on the same scan if you need a single shared accumulator).",
    "sections": {
      "Why": "Stateful scan over a `RefSubject` / `Computed`, producing a `Computed` of the accumulated state.\nFx subscriptions follow `Fx.scan` semantics (emit `initial`, then fold each source value).\nEffect sampling accumulates across source versions via a private state ref (do not mix heavy\nsubscribe + sample on the same scan if you need a single shared accumulator). The result remains\na lazy view rather than a duplicated mutable value.",
      "Ownership and lifetime": "Each Effect Context object gets a private current-read accumulator, advanced after a successful\nfold for a new source version. The pushed channel runs `Fx.scanEffect` from `initial` inside\n`Subject.hold`: observers using the same Context share that active scan and retained result.\nThe last observer ends its session and clears its held value. The observing Scope owns\nsubscription cleanup. Read accumulators are weakly held by Context and need no finalizer."
    },
    "examples": [],
    "relations": [],
    "source": {
      "file": "packages/fx/src/RefSubject/RefSubject.ts",
      "line": 961
    },
    "since": "1.0.0",
    "category": "Accumulation"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#RefSubject.scan",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.13",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "RefSubject",
    "qualifiedName": "RefSubject.scan",
    "declarationKey": "declaration:9d7c8533622a0cdf8fa50add",
    "family": "variable",
    "signatures": [
      "export declare const scan: {\n    <S, A>(initial: S, f: (s: S, a: A) => S): <E, R>(ref: RefSubject<A, E, R> | Computed<A, E, R>) => Computed<S, E, R>;\n    <A, E, R, S>(ref: RefSubject<A, E, R> | Computed<A, E, R>, initial: S, f: (s: S, a: A) => S): Computed<S, E, R>;\n    <R0, E0, A, E, R, E2, R2, S>(versioned: Versioned.Versioned<R0, E0, A, E, R, A, E2, R2>, initial: S, f: (s: S, a: A) => S): Computed<S, E0 | E | E2, R0 | R2 | Exclude<R, Scope.Scope>>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 961,
          "column": 14
        },
        "end": {
          "line": 993,
          "column": 3
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 962,
          "column": 3
        },
        "end": {
          "line": 965,
          "column": 80
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 967,
          "column": 3
        },
        "end": {
          "line": 971,
          "column": 24
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 973,
          "column": 3
        },
        "end": {
          "line": 977,
          "column": 66
        }
      }
    ],
    "aliases": [
      "@typed/fx/RefSubject#scan"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#RefSubject",
    "static": false,
    "importedFrom": "declaration:9d7c8533622a0cdf8fa50add"
  },
  "declaration": {
    "declarationKey": "declaration:9d7c8533622a0cdf8fa50add",
    "name": "scan",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const scan: {\n    <S, A>(initial: S, f: (s: S, a: A) => S): <E, R>(ref: RefSubject<A, E, R> | Computed<A, E, R>) => Computed<S, E, R>;\n    <A, E, R, S>(ref: RefSubject<A, E, R> | Computed<A, E, R>, initial: S, f: (s: S, a: A) => S): Computed<S, E, R>;\n    <R0, E0, A, E, R, E2, R2, S>(versioned: Versioned.Versioned<R0, E0, A, E, R, A, E2, R2>, initial: S, f: (s: S, a: A) => S): Computed<S, E0 | E | E2, R0 | R2 | Exclude<R, Scope.Scope>>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 961,
              "column": 14
            },
            "end": {
              "line": 993,
              "column": 3
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<S, A>(initial: S, f: (s: S, a: A) => S): <E, R>(ref: RefSubject<A, E, R> | Computed<A, E, R>) => Computed<S, E, R>;",
          "<A, E, R, S>(ref: RefSubject<A, E, R> | Computed<A, E, R>, initial: S, f: (s: S, a: A) => S): Computed<S, E, R>;",
          "<R0, E0, A, E, R, E2, R2, S>(versioned: Versioned.Versioned<R0, E0, A, E, R, A, E2, R2>, initial: S, f: (s: S, a: A) => S): Computed<S, E0 | E | E2, R0 | R2 | Exclude<R, Scope.Scope>>;"
        ],
        "typeParameters": [
          "S",
          "A",
          "E",
          "R",
          "R0",
          "E0",
          "E2",
          "R2"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 962,
              "column": 3
            },
            "end": {
              "line": 965,
              "column": 80
            }
          },
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 967,
              "column": 3
            },
            "end": {
              "line": 971,
              "column": 24
            }
          },
          {
            "file": "packages/fx/src/RefSubject/RefSubject.ts",
            "start": {
              "line": 973,
              "column": 3
            },
            "end": {
              "line": 977,
              "column": 66
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const scan: {\n    <S, A>(initial: S, f: (s: S, a: A) => S): <E, R>(ref: RefSubject<A, E, R> | Computed<A, E, R>) => Computed<S, E, R>;\n    <A, E, R, S>(ref: RefSubject<A, E, R> | Computed<A, E, R>, initial: S, f: (s: S, a: A) => S): Computed<S, E, R>;\n    <R0, E0, A, E, R, E2, R2, S>(versioned: Versioned.Versioned<R0, E0, A, E, R, A, E2, R2>, initial: S, f: (s: S, a: A) => S): Computed<S, E0 | E | E2, R0 | R2 | Exclude<R, Scope.Scope>>;\n};"
    ],
    "typeParameters": [
      "S",
      "A",
      "E",
      "R",
      "R0",
      "E0",
      "E2",
      "R2"
    ],
    "summary": "Stateful scan over a `RefSubject` / `Computed`, producing a `Computed` of the accumulated state.\n\nFx subscriptions follow `Fx.scan` semantics (emit `initial`, then fold each source value).\nEffect sampling accumulates across source versions via a private state ref (do not mix heavy\nsubscribe + sample on the same scan if you need a single shared accumulator).",
    "sections": {
      "Why": "Stateful scan over a `RefSubject` / `Computed`, producing a `Computed` of the accumulated state.\nFx subscriptions follow `Fx.scan` semantics (emit `initial`, then fold each source value).\nEffect sampling accumulates across source versions via a private state ref (do not mix heavy\nsubscribe + sample on the same scan if you need a single shared accumulator). The result remains\na lazy view rather than a duplicated mutable value.",
      "Ownership and lifetime": "Each Effect Context object gets a private current-read accumulator, advanced after a successful\nfold for a new source version. The pushed channel runs `Fx.scanEffect` from `initial` inside\n`Subject.hold`: observers using the same Context share that active scan and retained result.\nThe last observer ends its session and clears its held value. The observing Scope owns\nsubscription cleanup. Read accumulators are weakly held by Context and need no finalizer."
    },
    "examples": [],
    "sourceSpans": [
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 961,
          "column": 14
        },
        "end": {
          "line": 993,
          "column": 3
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 962,
          "column": 3
        },
        "end": {
          "line": 965,
          "column": 80
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 967,
          "column": 3
        },
        "end": {
          "line": 971,
          "column": 24
        }
      },
      {
        "file": "packages/fx/src/RefSubject/RefSubject.ts",
        "start": {
          "line": 973,
          "column": 3
        },
        "end": {
          "line": 977,
          "column": 66
        }
      }
    ],
    "since": "1.0.0",
    "category": "Accumulation"
  }
}
