Vuex can be quite repetitive to write generic mutations (arrays : set
, add
, update
, delete
, literals: update
) for each state property. But it's important to keep track of changes inside the store.
So here's a way to generate generic mutations and associated actions :
// book-store.js
const state = {
id: '',
title: '',
authors: [],