Full Stack Development with JHipster - Second Edition
by Deepu K Sasidharan, Sendil Kumar Nellaiyapen
State management with Vuex
Vuex (https://vuex.vuejs.org/guide/) is the official state management solution for Vue.js and is Redux inspired. JHipster uses Vuex for state management with Vue.js. It is also possible to use other state management solutions such as Redux and MobX.
Vuex provides a global immutable store that can only be updated by committing mutations explicitly. The store is also reactive, which means the components that use the store data are updated when the store changes. A mutation is a method that changes data in the store. You need to call the store commit method with the required mutation.
Vue components automatically get access to the store when you connect a store to an app. Let's take a look at src/main/webapp/app/core/home/home.component.ts ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access