const nested = Effect.gen(function* () {
const nestedService = yield* NestedService;
return nestedService.random();
});
const program = Effect.gen(function* () {
const _ = yield* nested;
const service = yield* Service;
const anotherService = yield* AnotherService;
return service.do(anotherService.something());
}).pipe(
Effect.tap(Effect.annotateCurrentSpan),
Effect.provide(NestedService.Default),
Effect.provide(Service.Default),
Effect.provide(AnotherService.Default),
Effect.tap(Effect.annotateCurrentSpan),
Effect.withSpan("@project/program"),
)
const nested = Effect.gen(function* () {
const nestedService = yield* NestedService;
return nestedService.random();
});
const program = Effect.gen(function* () {
const _ = yield* nested;
const service = yield* Service;
const anotherService = yield* AnotherService;
return service.do(anotherService.something());
}).pipe(
Effect.tap(Effect.annotateCurrentSpan),
Effect.provide(NestedService.Default),
Effect.provide(Service.Default),
Effect.provide(AnotherService.Default),
Effect.tap(Effect.annotateCurrentSpan),
Effect.withSpan("@project/program"),
)