Library for working with jsona data formater.
Basic store generation and usage.
import httpClient from 'axios';
import { itemStore } from 'jsona-vuex';
const store = new Vuex.Store(
itemStore({
resource: 'person',
httpClient,
})
);
You may load specific resource data by it is ID into store
store.dispatch('load', { id: 1 })
.then(person => console.log('person model', person));
store.dispatch('save', { item })
.then(person => console.log('new person model', person));
store.dispatch('delete')
.then(person => console.log('deleted person model', person));