{
  "id": "@typed/fx#Fx.sync",
  "canonicalId": "@typed/fx/Fx#sync",
  "symbol": {
    "id": "@typed/fx#Fx.sync",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "Fx.sync",
    "kind": "constant",
    "signatures": [
      "export declare const sync: <A>(evaluate: () => A) => Fx<A>;"
    ],
    "summary": "Lazily evaluates a synchronous function once for each Fx run.",
    "sections": {
      "Why": "`sync` is the direct constructor for one value that must be computed at run time,\nsuch as a fresh DOM node or a snapshot read from an imperative API. Unlike\n`succeed`, it does not evaluate the function while the Fx is being assembled.",
      "Ownership and lifetime": "Construction performs no work. Each run evaluates `evaluate` exactly once in the\nrun's fiber, emits its result, and completes after the Sink handles it. A thrown\nexception is an Effect defect; use `Fx.fromEffect(Effect.try(...))` when failure is\nexpected and belongs in the typed error channel."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Fx } from \"@typed/fx\"\n\nconst element = Fx.sync(() => document.createElement(\"div\"))"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/constructors/sync.ts",
      "line": 34
    },
    "since": "2.0.0",
    "category": "Value sources"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#Fx.sync",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.7",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "Fx",
    "qualifiedName": "Fx.sync",
    "declarationKey": "declaration:d1a858667562b4154ddb4c86",
    "family": "variable",
    "signatures": [
      "export declare const sync: <A>(evaluate: () => A) => Fx<A>;"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/constructors/sync.ts",
        "start": {
          "line": 34,
          "column": 14
        },
        "end": {
          "line": 34,
          "column": 87
        }
      }
    ],
    "aliases": [
      "@typed/fx/Fx#sync"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#Fx",
    "static": false,
    "importedFrom": "declaration:d1a858667562b4154ddb4c86"
  },
  "declaration": {
    "declarationKey": "declaration:d1a858667562b4154ddb4c86",
    "name": "sync",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const sync: <A>(evaluate: () => A) => Fx<A>;"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/constructors/sync.ts",
            "start": {
              "line": 34,
              "column": 14
            },
            "end": {
              "line": 34,
              "column": 87
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const sync: <A>(evaluate: () => A) => Fx<A>;"
    ],
    "typeParameters": [],
    "summary": "Lazily evaluates a synchronous function once for each Fx run.",
    "sections": {
      "Why": "`sync` is the direct constructor for one value that must be computed at run time,\nsuch as a fresh DOM node or a snapshot read from an imperative API. Unlike\n`succeed`, it does not evaluate the function while the Fx is being assembled.",
      "Ownership and lifetime": "Construction performs no work. Each run evaluates `evaluate` exactly once in the\nrun's fiber, emits its result, and completes after the Sink handles it. A thrown\nexception is an Effect defect; use `Fx.fromEffect(Effect.try(...))` when failure is\nexpected and belongs in the typed error channel."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Fx } from \"@typed/fx\"\n\nconst element = Fx.sync(() => document.createElement(\"div\"))"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/constructors/sync.ts",
        "start": {
          "line": 34,
          "column": 14
        },
        "end": {
          "line": 34,
          "column": 87
        }
      }
    ],
    "since": "2.0.0",
    "category": "Value sources"
  }
}
