While working with dependency injection in other projects i was able to create a dependency based in a previously registered dependency like the following example in Swinject
let container = Container()
container.register(Animal.self) { _ in Cat(name: "Mimi") }
container.register(Person.self) { r in
PetOwner(pet: r.resolve(Animal.self)!)
}
I have successfully created a single dependency in TCA but
Is there a way to do something like the previous code with TCA dependencies?
For example, a database client. The test and preview values likely do not need to reference other dependencies, but the live value may need to access an environment values client to get a connection string. Something like that. Usually it is the live values of dependencies that need to reference other dependencies.