vuex-reducer
v0.1.0
Published
Reducer in Vuex
Downloads
4
Maintainers
Readme
vuex-reducer
Reducer in Vuex.
Example
import Vue from 'vue'
import Vuex from 'vuex'
import { reducers } from 'vuex-reducer'
Vue.use(Vuex)
const store = new Vuex.Store({
state: {
value: {
name: 'foo'
},
history: []
},
mutations: reducers({
update: (state, name) => ({
value: {
name
},
history: [...state.history, state.value]
})
})
})
License
MIT