B
B
bormor2018-08-30 10:21:47
Vue.js
bormor, 2018-08-30 10:21:47

Vuex - what is the best way to initialize the state on the first load of the application?

Task:
when the user loads the application, get data from the server into the state - by executing a group of requests for this 1 time
First idea:
in the root component in the created () hook, I run actions for each module from Vuex
Question - will this group of requests be executed only 1 time?
Or will it be repeated every time the child components are re-rendered?
As I understand the work of virtual dom - this should not be.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question