{
  "id": "@typed/fx#Fx.provideContext",
  "canonicalId": "@typed/fx/Fx#provideContext",
  "symbol": {
    "id": "@typed/fx#Fx.provideContext",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "Fx.provideContext",
    "kind": "constant",
    "signatures": [
      "export declare const provideContext: {\n    <R2>(services: Context.Context<R2>): <A, E, R>(fx: Fx<A, E, R>) => Fx<A, E, Exclude<R, R2>>;\n    <A, E, R, R2>(fx: Fx<A, E, R>, services: Context.Context<R2>): Fx<A, E, Exclude<R, R2>>;\n};"
    ],
    "summary": "Provides an already-built Effect Context to the entire Fx run.",
    "sections": {
      "Why": "Callers that already own service instances should not rebuild them through a\nresourceful Layer merely to satisfy an Fx's environment.",
      "Ownership and lifetime": "The Context is captured when this combinator is created and reused for each\nsubscription. Its services are available to all source Effects and removed\nfrom `R`. This function does not acquire or release those service values;\ntheir owner must keep them valid for every subscription that uses the result.\nSource completion, failure, and interruption are unchanged."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Context, Effect } from \"effect\"\nimport { provideContext } from \"@typed/fx/Fx\"\nimport { fromEffect } from \"@typed/fx/Fx\"\n\nclass Config extends Context.Service<Config, { readonly url: string }>()(\"Config\") {}\nconst context = Context.make(Config, { url: \"/api\" })\nconst runnable = provideContext(fromEffect(Effect.map(Config, (x) => x.url)), context)"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/combinators/provide.ts",
      "line": 109
    },
    "since": "1.0.0",
    "category": "Providing services"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#Fx.provideContext",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.7",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "Fx",
    "qualifiedName": "Fx.provideContext",
    "declarationKey": "declaration:84c38e49a863f96822aeec50",
    "family": "variable",
    "signatures": [
      "export declare const provideContext: {\n    <R2>(services: Context.Context<R2>): <A, E, R>(fx: Fx<A, E, R>) => Fx<A, E, Exclude<R, R2>>;\n    <A, E, R, R2>(fx: Fx<A, E, R>, services: Context.Context<R2>): Fx<A, E, Exclude<R, R2>>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/provide.ts",
        "start": {
          "line": 109,
          "column": 14
        },
        "end": {
          "line": 117,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/provide.ts",
        "start": {
          "line": 110,
          "column": 3
        },
        "end": {
          "line": 110,
          "column": 95
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/provide.ts",
        "start": {
          "line": 112,
          "column": 3
        },
        "end": {
          "line": 112,
          "column": 91
        }
      }
    ],
    "aliases": [
      "@typed/fx/Fx#provideContext"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#Fx",
    "static": false,
    "importedFrom": "declaration:84c38e49a863f96822aeec50"
  },
  "declaration": {
    "declarationKey": "declaration:84c38e49a863f96822aeec50",
    "name": "provideContext",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const provideContext: {\n    <R2>(services: Context.Context<R2>): <A, E, R>(fx: Fx<A, E, R>) => Fx<A, E, Exclude<R, R2>>;\n    <A, E, R, R2>(fx: Fx<A, E, R>, services: Context.Context<R2>): Fx<A, E, Exclude<R, R2>>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/provide.ts",
            "start": {
              "line": 109,
              "column": 14
            },
            "end": {
              "line": 117,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<R2>(services: Context.Context<R2>): <A, E, R>(fx: Fx<A, E, R>) => Fx<A, E, Exclude<R, R2>>;",
          "<A, E, R, R2>(fx: Fx<A, E, R>, services: Context.Context<R2>): Fx<A, E, Exclude<R, R2>>;"
        ],
        "typeParameters": [
          "R2",
          "A",
          "E",
          "R"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/provide.ts",
            "start": {
              "line": 110,
              "column": 3
            },
            "end": {
              "line": 110,
              "column": 95
            }
          },
          {
            "file": "packages/fx/src/Fx/combinators/provide.ts",
            "start": {
              "line": 112,
              "column": 3
            },
            "end": {
              "line": 112,
              "column": 91
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const provideContext: {\n    <R2>(services: Context.Context<R2>): <A, E, R>(fx: Fx<A, E, R>) => Fx<A, E, Exclude<R, R2>>;\n    <A, E, R, R2>(fx: Fx<A, E, R>, services: Context.Context<R2>): Fx<A, E, Exclude<R, R2>>;\n};"
    ],
    "typeParameters": [
      "R2",
      "A",
      "E",
      "R"
    ],
    "summary": "Provides an already-built Effect Context to the entire Fx run.",
    "sections": {
      "Why": "Callers that already own service instances should not rebuild them through a\nresourceful Layer merely to satisfy an Fx's environment.",
      "Ownership and lifetime": "The Context is captured when this combinator is created and reused for each\nsubscription. Its services are available to all source Effects and removed\nfrom `R`. This function does not acquire or release those service values;\ntheir owner must keep them valid for every subscription that uses the result.\nSource completion, failure, and interruption are unchanged."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Context, Effect } from \"effect\"\nimport { provideContext } from \"@typed/fx/Fx\"\nimport { fromEffect } from \"@typed/fx/Fx\"\n\nclass Config extends Context.Service<Config, { readonly url: string }>()(\"Config\") {}\nconst context = Context.make(Config, { url: \"/api\" })\nconst runnable = provideContext(fromEffect(Effect.map(Config, (x) => x.url)), context)"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/provide.ts",
        "start": {
          "line": 109,
          "column": 14
        },
        "end": {
          "line": 117,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/provide.ts",
        "start": {
          "line": 110,
          "column": 3
        },
        "end": {
          "line": 110,
          "column": 95
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/provide.ts",
        "start": {
          "line": 112,
          "column": 3
        },
        "end": {
          "line": 112,
          "column": 91
        }
      }
    ],
    "since": "1.0.0",
    "category": "Providing services"
  }
}
