What Pinia is
Pinia (https://pinia.vuejs.org) is a state management library for Vue.js applications. As you saw in Chapter 9, The State of Vue State Management, handling data that must be synchronized between multiple different components requires some form of management. Pinia helps with this by providing a simple method of setting up a central store that contains your application’s state. Your components make use of this store to ensure they’re all using the same information.
Pinia began as an experiment for Vue 3 but evolved to support Vue 2 as well. Pinia is now the recommended state management library for Vue applications, with the venerable Vuex (https://vuex.vuejs.org/) now in maintenance mode:
Figure 10.1 – The Pinia website
Along with state management, using Pinia also provides other benefits, including the following:
- Devtools support via the Vue extension. This extension supports Chrome, Edge, and Firefox. There...