verx

Vuex inspired centralized state management library for all kinds of javascript applications

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

HomePage

https://github.com/jdkanani/verx

Repository

git+https://github.com/jdkanani/verx.git


相关推荐

暂无相关文章