{
  "id": "@typed/fx#Fx.suspend",
  "canonicalId": "@typed/fx/Fx#suspend",
  "symbol": {
    "id": "@typed/fx#Fx.suspend",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "Fx.suspend",
    "kind": "constant",
    "signatures": [
      "export declare const suspend: <A, E, R>(fx: () => Fx<A, E, R>) => Fx<A, E, R>;"
    ],
    "summary": "Defers creation of an `Fx` until each run begins.",
    "sections": {
      "Why": "Recursive producers and producers whose definition depends on fresh mutable state\nneed laziness at the `Fx` boundary, not merely laziness of a value emission.",
      "Ownership and lifetime": "`fx` is not evaluated during construction. It is evaluated once per run inside\n`Effect.suspend`; thrown exceptions become Effect defects, and the returned\nproducer is owned and interrupted as part of that same run."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { collectAll, succeed, suspend } from \"@typed/fx/Fx\"\n\nlet next = 0\nconst source = suspend(() => succeed(++next))\nconst firstRun = collectAll(source)\nconst secondRun = collectAll(source)"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/constructors/suspend.ts",
      "line": 33
    },
    "since": "1.0.0",
    "category": "Value sources"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#Fx.suspend",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.13",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "Fx",
    "qualifiedName": "Fx.suspend",
    "declarationKey": "declaration:c089a8ead9b5a50411e6b1aa",
    "family": "variable",
    "signatures": [
      "export declare const suspend: <A, E, R>(fx: () => Fx<A, E, R>) => Fx<A, E, R>;"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/constructors/suspend.ts",
        "start": {
          "line": 33,
          "column": 14
        },
        "end": {
          "line": 34,
          "column": 64
        }
      }
    ],
    "aliases": [
      "@typed/fx/Fx#suspend"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#Fx",
    "static": false,
    "importedFrom": "declaration:c089a8ead9b5a50411e6b1aa"
  },
  "declaration": {
    "declarationKey": "declaration:c089a8ead9b5a50411e6b1aa",
    "name": "suspend",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const suspend: <A, E, R>(fx: () => Fx<A, E, R>) => Fx<A, E, R>;"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/constructors/suspend.ts",
            "start": {
              "line": 33,
              "column": 14
            },
            "end": {
              "line": 34,
              "column": 64
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const suspend: <A, E, R>(fx: () => Fx<A, E, R>) => Fx<A, E, R>;"
    ],
    "typeParameters": [],
    "summary": "Defers creation of an `Fx` until each run begins.",
    "sections": {
      "Why": "Recursive producers and producers whose definition depends on fresh mutable state\nneed laziness at the `Fx` boundary, not merely laziness of a value emission.",
      "Ownership and lifetime": "`fx` is not evaluated during construction. It is evaluated once per run inside\n`Effect.suspend`; thrown exceptions become Effect defects, and the returned\nproducer is owned and interrupted as part of that same run."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { collectAll, succeed, suspend } from \"@typed/fx/Fx\"\n\nlet next = 0\nconst source = suspend(() => succeed(++next))\nconst firstRun = collectAll(source)\nconst secondRun = collectAll(source)"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/constructors/suspend.ts",
        "start": {
          "line": 33,
          "column": 14
        },
        "end": {
          "line": 34,
          "column": 64
        }
      }
    ],
    "since": "1.0.0",
    "category": "Value sources"
  }
}
