How to Merge Layers with Conditional Logic in TypeScript
Can I change a layer's tag? The x problem is that I have a FooLiveA and a FooLiveB from a package, and I want to merge them as a NewFooLive:
const NewFooLive = Layer.effect(
Foo,
Effect.gen(function* () {
const fooA = yield* Foo
const fooB = yield* Foo
return {
foo: Effect.gen(function* () { if (someCondition) fooA.foo() else fooB.foo() })
}
})
)