[Vuejs]-Vuex Modal Store Best Practice

0👍

I believe it depends on the complexity of the code you’re going to write. If it’s just a few actions/mutations, I would stick to the calendar store. Working with multiple modules is great, but people tend to create way too many modules even when there’s not an actual reason to

0👍

It’s a good practice to separate by concern. If you need to build a stateful Calendar in your BookingEditor, you could end up with quite some actions and mutations, so having a seperate place to handle those concerns would then be a good idea.

Vuex offers a nice way to create namespaces. So in your case I would suggest to create a store for your Calendar in a namespace like:

BookingEditor/Calendar

Read more about namespacing in the vuex manual

Leave a comment