Skip to content

Commit

Permalink
chore, closes #436
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti committed Jan 20, 2024
1 parent eebdfb5 commit 97bbe96
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pages/docs/context-management/services.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,13 @@ To execute the `program`, we need to provide implementations for both services:

Alternatively, instead of calling `provideService` multiple times, we can combine the service implementations into a single `Context`:

```ts file=<rootDir>/src/context-management/services/multiple-services-pipe.ts#L39-L48
```ts file=<rootDir>/src/context-management/services/multiple-services-pipe.ts#L39-L43

```

and then provide the entire context using the `Effect.provide` function:

```ts file=<rootDir>/src/context-management/services/multiple-services-pipe.ts#L50-
```ts file=<rootDir>/src/context-management/services/multiple-services-pipe.ts#L45-

```

Expand Down
2 changes: 1 addition & 1 deletion src/context-management/services/multiple-services-pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const runnable1 = program.pipe(
)
)

// Context<Random | Logger>
// $ExpectType Context<Random | Logger>
const context = Context.empty().pipe(
Context.add(Random, Random.of({ next: Effect.sync(() => Math.random()) })),
Context.add(Logger, Logger.of({ log: Console.log }))
Expand Down

0 comments on commit 97bbe96

Please sign in to comment.