type AvailableService = ServiceA | ServiceB | ServiceC
// result effect type will be Effect.Effect<A, E, AvailableService>
// error and success should be mapped properly.
const effect = fromEffect(
Effect.gen(function* () {
const svcA = yield* ServiceA
const svcD = yield* ServiceD
const svcE = yield* ServiceE
// ...rest of code...
}),
{
// if there are not extra service then it should be optional, else required those extra services
dependencies: [ServiceD.Default, ServiceE.Default] // this should give type error as ServiceD and ServiceE is required, unless provided
}
)
type AvailableService = ServiceA | ServiceB | ServiceC
// result effect type will be Effect.Effect<A, E, AvailableService>
// error and success should be mapped properly.
const effect = fromEffect(
Effect.gen(function* () {
const svcA = yield* ServiceA
const svcD = yield* ServiceD
const svcE = yield* ServiceE
// ...rest of code...
}),
{
// if there are not extra service then it should be optional, else required those extra services
dependencies: [ServiceD.Default, ServiceE.Default] // this should give type error as ServiceD and ServiceE is required, unless provided
}
)