Injecting Dependencies for Layer Construction in Effect Typescript Library
I am a little confused about providing dependencies during layer construction, especially with the logger and config because they are not visible in function signatures.
The question I am asking (I think) is whether it's possible to inject dependencies for layer construction at the edge of the program like runtime dependencies.
It looks like I have to provide dependencies like so if I am using a custom config provider or logger and I make use of them in the construction phase, for example in
Injecting the config is something I would really like to do only a few times, if not once, in my app, but it looks like I would have to do it each time a layer depends on it for its construction, unless the config is in process.env and the default provider picks it up, which is what happens in production but not in development.
I am using Remix and during development it uses dotenv to load any .env file (vite can also do it it seems), which is a behaviour I actually don't like because I also need to read my config before remix is initialized, which would force me to call dotenv myself first just for development and pray for remix to do it the same way I do
The question I am asking (I think) is whether it's possible to inject dependencies for layer construction at the edge of the program like runtime dependencies.
It looks like I have to provide dependencies like so if I am using a custom config provider or logger and I make use of them in the construction phase, for example in
retryLogic:Injecting the config is something I would really like to do only a few times, if not once, in my app, but it looks like I would have to do it each time a layer depends on it for its construction, unless the config is in process.env and the default provider picks it up, which is what happens in production but not in development.
I am using Remix and during development it uses dotenv to load any .env file (vite can also do it it seems), which is a behaviour I actually don't like because I also need to read my config before remix is initialized, which would force me to call dotenv myself first just for development and pray for remix to do it the same way I do
