[Vuejs]-Design pattern for Vue app with backend REST API

0👍

Your idea with complex chain of watchers is totally dangerous to scale up app. There will be a lot of problems with maintaining all emits especially when someone new will be in the project. You should keep all states that acts on application in Vuex, it’s very simple to implement and this will give you great benefits in the future.

0👍

I advise using Vuex. The EventBus is useful but not as organized as a Vuex store.

Tips on Vuex usage for your scenario:

  • I put all my API calls in my store’s actions as well.
  • Break your store into modules to keep it even more organized.
  • Use computed properties in your components to use the store data.

Leave a comment