When to initially load state from database with Vuex When to initially load state from database with Vuex vue.js vue.js

When to initially load state from database with Vuex


Instead of running the request from your component and filling the state with the results, you can dispatch an action which makes the request and commits the mutation with the results. If you want it to happen immediately, dispatch the actions from the create method of the root vue node.