I need to store different entities in my vuex-store. For example Companies, Employees and Workplaces...
These entities are connected by ID-Arrays.
- Company.employees is an array of UserIds
- Employee.workplaces is a list of workplace ids
- ...
I implemented it both ways I know:
- as a single very big store
- with store modules for every entity
The first approach is straightforward but quickly becomes very bloated. The second approach is very clean but data handling is difficult when I need data from 2 stores to fulfill a getter (for example: getWorkplacesByCompany)
What is the preferred way to store such data?