DEV Community

Discussion on: 3 tips for scaling large Vue.js application

Collapse
 
omermarcovich profile image
OmerMarcovich • Edited

Hey Maxence,
Thanks for your article.

Can you explain, based on your architecture, what does the "catalog.services.js" file contain? Or more precisely, what is it used for?
Thanks a lot.

Collapse
 
maxpou profile image
Maxence Poutord

Hey!
***.services.js files are meant to host some business rules that can be reused across the app. For instance, in the catalog context, you can have some function related to the tax calculation, function regarding the product availability in a country...

Another thing: if you extract those kind of function in a specific files, it make your code easier to test. (you don't need to load the full app to test each edges cases)