Feed store state with async data at application start
[issue link]Hey there,
I am getting started with Vuex and Nuxt (which really is awesome) and I am facing a problem for hours.
My application is an Electron one. Basically what I want to do is stated in the title. I’ll give some code for it to be more clear.
What I want to do is feeding store.state.randomVariable with some async data on application start.
My method is a promise. This is what I would like to do.
// At start
getLatest().then((items) => {
store.state.releases = items
}
As those data would not be hear on page rendering, I should then see them app on my html as if I would do it with basic Vue and without reloading of course with something like this:
let vm = new Vue({
el: '#some-element',
data: {
releases: []
}
})
getLatest().then((items) => {
vm.releases = items
})
I tried working with middleware and some other things but I could not get it working. I would really appreciate a hand on this.
Thank you!