Refactoring Service Dependencies with Layer Merging in TypeScript

Another Layer question - I believe what I am doing is "bad practice" so I need to refactor it.

Effect.provideService(Authorize, authorizeMock),
  Effect.provideService(Tokens, mockTokens),
  Effect.provideService(Request, mockRequest),
  Effect.provideService(CustomHtmlTemplate, mockCustomHtmlTemplate),
  Effect.provideService(CookieService, cookieServiceTest),


So in this situation - Authorize, Tokens, CustomHtmlTemplate all use "Request"

So really I should make Authorize, Tokens, CustomHtml a Layer that is built with Request.

Then Layer.mergeAll(Authorize, Tokens, CustomHtml) and provide Request.
Was this page helpful?