f / vue-wait

Complex Loader and Progress Management for Vue/Vuex and Nuxt Applications
MIT License
2k stars 101 forks source link

Documentation: describe vuex getters #38

Closed Koc closed 6 years ago

Koc commented 6 years ago

Documentation for vuex integration looks incomplete. Please show how to access vuex getters inside other getters. Like

    [Getters.cartOperationsInProgress]: (state: CartState, getters, rootState, rootGetters): boolean => {
        console.log('cartOperationsInProgress');

        return rootGetters['wait/is']('cart.*');
    },
f commented 6 years ago

I would use mapWaitingGetters instead.

import { mapWaitingGetters } from 'vue-wait'

export default {
  computed: {
    ...mapWaitingGetters({
      cartOperationsInProgress: 'cart.*'
    }),
  },
}

But for the more complex usages, we should add your example, too.

f commented 6 years ago

Done: https://github.com/f/vue-wait/commit/776a331041aa07dd975a69e19a325029f6f63ae5

Koc commented 6 years ago

thank you