0.0.1 • Published 8 years ago
verx v0.0.1
Verx
Lightweight vuex inspired centralized state management library for all kinds of javascript applications.
install
npm install --save verx # yarn add verxExample
import Verx from 'verx';
const countStore = {
state: {
count: 0
},
mutations: {
increment(state) {
state.count++;
}
}
};
const store = new Verx({
modules: {
countStore
}
});Now, you can can access the state object as store.getState('countStore'), and trigger a state change with the store.commit method:
store.commit('countStore/increment');
console.log(store.getState('countStore').count); // -> 10.0.1
8 years ago