Defining Service Dependencies in Effect Typescript Library

Hi 👋.

Quick question about services and layer dependencies. Am I supposed to define dependencies between my services like this:
export class ProfilesRepository extends Effect.Service<ProfilesRepository>()(
 'repositories/Profiles',
 {
   dependencies: [Database.Default], // <--- Is this correct?
   effect: Effect.gen(function* () {
      ...
   })
 }
) {}

In my mind the "ideal" way is to not define any direct link to a layer in the definition and to leave that for the outermost part of the application, where we provide all dependencies at once.

The example in the docs shows this but because its using NodeFileSystem, so declaring a dependency to an external API of the node runtime, I'm not certain if the same pattern should be followed for application-level deps.

Thanks for any tips ahead of time!
Was this page helpful?