What is the purpose of `/libs/services`
What is the purpose of /libs/services? It contains only empty files.
I am sorry you have come across my sorely neglected enterprise-react-example repo, this badly needs an update.
To answer you question I am going to assume you have seen the talk or the slides How to Build Large Scale React apps, and if not check those out and that might be the answer you are looking for.
So the reason I want to separate out services from the store is:
It's a good idea to look for places where the abstractions make sense.
The services are generally going to be very re-usable, usually they end up being an instance of an "API Client" or and abstraction over some browser API (like peer-to-peer streams or something), and they are usually complex enough that you can hide a lot of mapping logic, and DTO types and sometimes behaviours like pilling or realtime, behind some some async functions/methods like getWhatever() that the service exports or exposes.
This is generally a good idea because it let's your store layer focus on just combining/aggregating, updating state, and figuring out whatever business logic needs to be performed on the client. The stores are easier to test, because they can just mock the services provided to them, and they never have to know about things like DTOs or what transport layers they have to mock (like http or websockets or whatever), they just ask for some data and they get it asynchronously.
The higher level answer is, it's good to find places in your code that you can isolate, and offer a minimal interface to, and hide complexity behind that. In my experience, the services is a good place, it lets you abstract and isolate a bunch of code dealing with APIs and Browser features, which end up being easily replaceable and reusable and testable.
Is that the answer you were looking for or have I misunderstood the question?
Oh HA! Sorry, just looked at the repo...
This is just because I never finished this example. I am sorry. 😄
I should finish this, and update it, someday. 🤦
Ok, thanks for the explanation