@madsoap/vix

0.0.1 • Public • Published

soap-vix

Installation

npm install vix --save-dev

Usage

// store/modules/base.js
export default {
  state: {
    page: {
      state: 'pending'
    },
    mask: {
      show: false
    }
  },
  mutators: {
    INIT ({state,dispatch},action) {
      state.state = 'ready';
      dispatch({
        type: 'FETCH_USER'
      })
    }
  }
}
// store/modules/user.js
export default {
  state: {
    user: {
      loggedIn: false,
      name: ''
    }
  },
  mutators: {
    FETCH_USER ({state,dispatch},action) {
      state.user.loggedIn = true;
      state.user.name = 'root';
    }
  }
}
// store/store.js
import Vue from 'vue';
import Vix from 'soap-vix';
import base from 'store/modules/base.js';
import user from 'store/modules/user.js';
Vue.use( Vix );

const store = Vix.createStore([base,user]);

new Vue({
  store
})

License

MIT

Dependents (0)

Package Sidebar

Install

npm i @madsoap/vix

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

4.6 kB

Total Files

5

Last publish

Collaborators

  • madsoap