Skip to content

ktsn/vuex-reducer

Repository files navigation

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

About

Reducer in Vuex

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published