0.0.1 • Published 6 years ago

verx v0.0.1

Weekly downloads
6
License
MIT
Repository
github
Last release
6 years ago

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