learningequality / kolibri

Kolibri Learning Platform: the offline app for universal education
https://learningequality.org/kolibri/
MIT License
762 stars 635 forks source link

Upgrade to Vuex3 #2022

Closed rtibbles closed 5 years ago

rtibbles commented 6 years ago

Summary

Vuex3 will allow better and more modular Vuex state management.

jonboiser commented 6 years ago

One thing we can start doing now that won't break anything is move functions in options.vuex.getters to options.computed and options.vuex.actions to options.methods, like in this diff

rtibbles commented 6 years ago

Do we want to have mapGetters as a universal helper function that we can then swap out for the vuex mapGetters function?

jonboiser commented 6 years ago

Yeah, that's why I named them so similarly. It wouldn't be an exact swap though.

pre vuex3

      ...mapGetters({
        isAdmin,
        isCoach,
        classCoaches,
        isSuperuser,
        className,
      }),

vuex 3 (assuming these getters are defined on your store/module

      ...mapGetters([
        'isAdmin',
        'isCoach',
        'classCoaches',
        'isSuperuser',
        'className',
      ]),
indirectlylit commented 6 years ago

@jonboiser please close this issue once your final introduction of modules for page state has been merged