When to use state management
The first and most important part of this chapter is learning when it is appropriate to use Pinia in your application and when it is not.
All extra packages and features that are added to an application come with an extra cost. This cost is in the time that it takes to learn these new skills, the extra time that a new feature may take to build, the extra complexity that the overall architecture may add to the project, and finally the extra size that another package adds to your JavaScript bundle.
Adding a state manager to your application falls into this category of possible features that may not always be needed. Luckily for us, adding and utilizing Pinia is simple and does not add as much overhead to the project as other counterparts such as React Redux.
The rule of thumb is that state management should only be added to a project if the project is complex enough and includes many layers of components, and if passing values across the application...