Making Layers Behave Like Modules for Global Dependencies
[SOLVED]
Hello
How to make Layers behave like NestJS modules, where you can add another module in the imports array and set it as a Global dependency?
I have
This works:
This worksn't:
In other words, if I let AppLayer provide AppService, it doesn't work, but if I add AppService to the main pipeline after adding all the layers, it works.
Hello
How to make Layers behave like NestJS modules, where you can add another module in the imports array and set it as a Global dependency?
I have
PostLayer, AuthLayer, AppLayer, DbLayer. Each of these layers inject their own API routes (Effect.gen), or services, or child layers using Layer.mergeAll. The AppService which starts the Hono server, and provides it as App tag, only works if I add it to the main pipeline in the main Effect.runFork. So apparently Layers don't work like modules or groups , or maybe they do but they don't inject services globally... This works:
This worksn't:
In other words, if I let AppLayer provide AppService, it doesn't work, but if I add AppService to the main pipeline after adding all the layers, it works.
