Servuex is a tiny library that allows more intuitive interactions with Vuex stores. This project represents the way of using Servuex on top of Vuex store.
Under the services
directory, you could find a simple user.service.js
implementation.
It has 2 properties (the state) firstName
and lastName
. They initially set to some placeholders. It also has a getter that creates a fullName
using firstName
and lastName
. Last but not least are two methods (one is async and the other not) that manipulate state properties.
The user state properties are referenced in the Header component and in the Home and About views.
Once the app is up, it calls the getUserData
method. The user name is updated, and so the components and views that use it.
Here is a running example of the project - https://forforeach.github.io/servuex-example
While you check it out, open the Vue dev tools and follow the actions that happen inder the Vuex tab
npm install
npm run serve
npm run build
npm run test:unit
npm run lint