Check out a free preview of the full Vuex for Intermediate Vue 2 Developers course

The "Vuex Modules Exercise" Lesson is part of the full, Vuex for Intermediate Vue 2 Developers course featured in this preview video. Here's what you'd learn in this lesson:

Students are instructed to move the various stores of the vending machine application into different modules.


Transcript from the "Vuex Modules Exercise" Lesson

>> What we'll do now is we're going to utilize some of this concepts and move all of our code into separate vuex modules. So we're gonna take our store, our getters, our actions and then move them into separate vuex modules. We're gonna move into the solution for this particular exercise.

And for that, I'm going to cd into my specific thing and I'm currently checked out in the right place. I'm gonna show you what the code looks like, because I think again, it's valid for you to see what exactly we are doing. Let's look at what the code looks like.

So we have our instance of inventory and then we have the machine state as well. And again, don't worry about functionality or anything cuz nothing is hooked up, nothing works. It's purely just to show you the extrapolation of modules.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now