yarn vuex 2.0.0-rc.3

latest releases: 4.1.0, 4.0.2, 4.0.1...
7 years ago

Changes from 2.0.0-rc.1

New

  • reverted store.watch deprecation.

  • New method: store.onActionsResolved(cb)

    Call the callback when all current pending actions (ones that return Promises) have been resolved. This is useful for determining initial data fetch completion during server-side rendering.

  • New helper: mapState

    Directly map store state to computed properties.

    computed: {
      // other properties...
      ...mapState({
        count: state => state.count,
        withGetters (state, getters) {
          return state.count + getters.countPlusOne + this.prop // <- also has access to `this`
        }
      })
    }
  • New helper: mapMutations

    Same as mapActions except for committing mutations instead.

  • Actions now also have access to getters and root state (for module actions):

    actions: {
      example: ({ state, getters, rootState, commit }) => {
        // ...
      }
    }
  • Getters now also have access to other getters and root state (for module getters):

    getters: {
      example: (state, getters, rootState) => {
      }
    }

Fixed

  • #243 dynamically registering module should not throw in strict mode

Don't miss a new vuex release

NewReleases is sending notifications on new releases.