Implementing Dependency Injection for AuthService with UserService in TypeScript
New to effect. I have a
My implementation is as follows
In a seperate file I have an implementation for
I am currently creating the
This is returning the correct type of
I saw in the docs the example given is
but this requires an in line definition of the function. Is there a certain way I should be providing the layers requirements instead?
UserService that I am using to create a UserServiceLive: Layer.Layer<UserService, never, never> and I have an AuthService that I want to use to create a AuthServiceLive: Layer.Layer<AuthService, never, UserService> that depends on the UserServiceMy implementation is as follows
In a seperate file I have an implementation for
signInWithUsername on the AuthServiceI am currently creating the
AuthServiceLive layer as followsThis is returning the correct type of
Layer.Layer<AuthService, never, UserService> however I feel like this might not be the *correct * way to provide the requirements. I saw in the docs the example given is
but this requires an in line definition of the function. Is there a certain way I should be providing the layers requirements instead?
