verx

0.0.1 • Public • Published

Verx

Lightweight vuex inspired centralized state management library for all kinds of javascript applications.

install

npm install --save verx # yarn add verx 

Example

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); // -> 1

Package Sidebar

Install

npm i verx

Weekly Downloads

3

Version

0.0.1

License

MIT

Unpacked Size

174 kB

Total Files

15

Last publish

Collaborators

  • jdkanani