Defining services in the Effect Typescript library involves creating abstractions that represent ...
I have a beginner question about how to define services.
Let's say I want to define a couple of operations I can do on a remote system (maybe 2 or 3 different API calls) that may or not be related to each other, in terms of business area, but are grouped together since they all communicate with the same external system.
The "effect" way of defining such operations would be to define a Effect.Service class, with a live implementation inside, or use Context.Tag and provide a live implementation separately, right? If I want to use such operations without requiring the whole class before, I'd be using the the
serviceFunction*
serviceFunction*
functions, which don't work properly when generics are involved. Is that correct?
What if I want to start defining my operations as functions, and only group them later? Is that possible, so that when I need a couple functions I have to provide the "whole class"?