vdeux
v2.1.4
Published
redux-vue binding
Downloads
14
Readme
vdeux(3) -- redux-vue binding
vdeux
requiresvue>=2.1.0
$ yarn add redux vdeux
# or
$ npm install --save redux vdeux
usage
import Vue from 'vue'
import vdeux from 'vdeux'
import configureStore from './store'
import {increment} from './store/actions'
const store = configureStore()
Vue.use(vdeux(store))
const vm = new Vue({
map: (state) => ({
count: state
}),
actions: {increment},
created () {
this.$actions.increment()
this.$actions.increment()
}
})
// expect(vm.$state.count).toBe(2)
// expect(vm._store).toBe(store)