# Fx.provideContext

Provides an already-built Effect Context to the entire Fx run.

## Signatures

```ts
export declare const provideContext: {
    <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>>;
};
```

## Why

Callers that already own service instances should not rebuild them through a
resourceful Layer merely to satisfy an Fx's environment.

## Ownership and lifetime

The Context is captured when this combinator is created and reused for each
subscription. Its services are available to all source Effects and removed
from `R`. This function does not acquire or release those service values;
their owner must keep them valid for every subscription that uses the result.
Source completion, failure, and interruption are unchanged.

## Examples

```ts
import { Context, Effect } from "effect"
import { provideContext } from "@typed/fx/Fx"
import { fromEffect } from "@typed/fx/Fx"

class Config extends Context.Service<Config, { readonly url: string }>()("Config") {}
const context = Context.make(Config, { url: "/api" })
const runnable = provideContext(fromEffect(Effect.map(Config, (x) => x.url)), context)
```
