Code for Layer and Services.
I have the following code to play with Layer & services: https://gist.github.com/khoinguyen/ff6b51ba39b296a020063d393a966e7a (sorry, the code is long and cannot post directly here)
As the output show, the function are construct the
The problem is I working in a legacy app which not Effect-TS as a whole, I want to migrate part of it to Effect-TS by refactor the Promise function called before to Effect. So I cannot push the provide layer to main program.
I see in the document it have Effect.provideContext, but got this when try to construct the Context, I got this error:
Not sure what API to use here.
Please advise, any changes to make better code are very appreciated.
As the output show, the function are construct the
conntrackEffect every time the function called. I understand it is because I provide the layer in each function. The problem is I working in a legacy app which not Effect-TS as a whole, I want to migrate part of it to Effect-TS by refactor the Promise function called before to Effect. So I cannot push the provide layer to main program.
I see in the document it have Effect.provideContext, but got this when try to construct the Context, I got this error:
Not sure what API to use here.
Please advise, any changes to make better code are very appreciated.
Gist
A simple Connection tracking with Effect-Ts. GitHub Gist: instantly share code, notes, and snippets.
