f / vue-wait

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

Proposal: extend createActionHelpers api #21

Closed fxmaxvl closed 6 years ago

fxmaxvl commented 6 years ago

Hi, I have a proposal: add 2 action helpers - mapActions and mapDecoratedActions

https://gist.github.com/fxmaxvl/9353355f352561376812e90cff6a8a8b

mapActions: It just extends action's context and provides $loading property with startLoading and endLoading helpers. It makes module's actions code cleaner and more testable.

mapDecoratedActions: It wraps action in try/finally block. It can significantly reduce a boilerplate code with startLoading / endLoading.

f commented 6 years ago

Please review v1.0.0 PR that adds this feature.

f commented 6 years ago

Please upgrade to "vue-wait": "^1.1.1"