Answer the question
In order to leave comments, you need to log in
Structure of a Vue/Vuex app?
When reading various manuals on the structure of client applications, among other folders, they mention such a folder as /services. And damn it, in 90% of these manuals, the contents of this folder are described as: api, etc. And nowhere is this mysterious, etc., deciphered. Who is experienced, tell me what you need to put in this / services? I understand that maybe everything depends on the project, but in a broad sense, what is this folder for?
Answer the question
In order to leave comments, you need to log in
There should be classes that encapsulate some logic, for example, for working with api. And the folder is empty, because there are stores, there are mixins that act as services. In Angular 2+, for example, there is no store, but there are services, they are usually made as singletons, injected into components and through them they request data changes, and also subscribe to this very data, the services folder is always packed there. Further, if you have two components that cannot be made one, but they have similar tasks, then in Angular you need to create a service and keep the logic in it (for example, a service for tracking scrolling), in Vue there are mixins for this.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question