{
  "id": "@typed/fx#Fx.Service",
  "canonicalId": "@typed/fx/Fx#Service",
  "symbol": {
    "id": "@typed/fx#Fx.Service",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "Fx.Service",
    "kind": "function",
    "signatures": [
      "export declare function Service<Self, A, E = never>(): <const Id extends string>(id: Id) => Fx.Class<Self, Id, A, E>;"
    ],
    "summary": "Defines an Effect service whose value is also a directly runnable `Fx`.",
    "sections": {
      "Why": "Applications often need a producer selected by the Effect environment: a clock,\nevent source, transport, or domain feed. `Service` keeps that dependency in `R`\nand provides the corresponding layer constructor without a parallel wrapper API.",
      "Ownership and lifetime": "Defining the class starts no work. `Class.make` acquires the producer when its layer\nis built, supplies the acquisition context to it, and binds its lifetime to the\nlayer scope. Running the class reads the currently installed implementation."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect, Layer } from \"effect\"\nimport { Fx } from \"@typed/fx\"\n\nclass Ticks extends Fx.Service<Ticks, number>()(\"app/Ticks\") {}\n\nconst TicksLive = Ticks.make(Fx.succeed(1))\nconst values = Fx.collectAll(Ticks).pipe(Effect.provide(TicksLive))\nconst program = Effect.map(values, (items) => items[0])"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/Fx.ts",
      "line": 482
    },
    "since": "1.0.0",
    "category": "Providing services"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#Fx.Service",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.13",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "Fx",
    "qualifiedName": "Fx.Service",
    "declarationKey": "declaration:d47d9b2d444ddb30cdf34701",
    "family": "function",
    "signatures": [
      "export declare function Service<Self, A, E = never>(): <const Id extends string>(id: Id) => Fx.Class<Self, Id, A, E>;"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/Fx.ts",
        "start": {
          "line": 482,
          "column": 1
        },
        "end": {
          "line": 516,
          "column": 2
        }
      }
    ],
    "aliases": [
      "@typed/fx/Fx#Service"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#Fx",
    "static": false,
    "importedFrom": "declaration:d47d9b2d444ddb30cdf34701"
  },
  "declaration": {
    "declarationKey": "declaration:d47d9b2d444ddb30cdf34701",
    "name": "Service",
    "family": "function",
    "facets": [
      {
        "family": "function",
        "syntaxKind": "FunctionDeclaration",
        "signatures": [
          "export declare function Service<Self, A, E = never>(): <const Id extends string>(id: Id) => Fx.Class<Self, Id, A, E>;"
        ],
        "typeParameters": [
          "Self",
          "A",
          "E = never"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/Fx.ts",
            "start": {
              "line": 482,
              "column": 1
            },
            "end": {
              "line": 516,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare function Service<Self, A, E = never>(): <const Id extends string>(id: Id) => Fx.Class<Self, Id, A, E>;"
    ],
    "typeParameters": [
      "Self",
      "A",
      "E = never"
    ],
    "summary": "Defines an Effect service whose value is also a directly runnable `Fx`.",
    "sections": {
      "Why": "Applications often need a producer selected by the Effect environment: a clock,\nevent source, transport, or domain feed. `Service` keeps that dependency in `R`\nand provides the corresponding layer constructor without a parallel wrapper API.",
      "Ownership and lifetime": "Defining the class starts no work. `Class.make` acquires the producer when its layer\nis built, supplies the acquisition context to it, and binds its lifetime to the\nlayer scope. Running the class reads the currently installed implementation."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect, Layer } from \"effect\"\nimport { Fx } from \"@typed/fx\"\n\nclass Ticks extends Fx.Service<Ticks, number>()(\"app/Ticks\") {}\n\nconst TicksLive = Ticks.make(Fx.succeed(1))\nconst values = Fx.collectAll(Ticks).pipe(Effect.provide(TicksLive))\nconst program = Effect.map(values, (items) => items[0])"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/Fx.ts",
        "start": {
          "line": 482,
          "column": 1
        },
        "end": {
          "line": 516,
          "column": 2
        }
      }
    ],
    "since": "1.0.0",
    "category": "Providing services"
  }
}
