Clarification on Using Effect.Service and Dependencies in Effect Typescript
Hey, playing around with the DI system right now and just wanted to make sure I understand stuff correctly.
Currently I am trying to integrate better-auth and drizzle. I have the following code now:
My questions is if I used Effect.Service correctly here? The
Idk just so many patterns and I am unsure of the the tradeoffs/differences
Currently I am trying to integrate better-auth and drizzle. I have the following code now:
My questions is if I used Effect.Service correctly here? The
dependencies part seems to most confusing. If I understand correctly its a sort of default implementation of the dependencies the Service uses correct? Not sure if it would have been better if I used Layer.provide(PgClient.layer({...})) at the entry of my programm instead where I also provide the PgDatabase. Or if I should have defined a static layerWithClient method in the PgDatabase class, that does the some thing Idk just so many patterns and I am unsure of the the tradeoffs/differences
