ManuelSch / vuex-rxjs

A type-safe Vuex alternative utilizing RxJS; Compatible with Vue Devtools
MIT License
11 stars 0 forks source link

Timing Issue in Vue lifecycle? #1

Closed CAJazzer closed 5 years ago

CAJazzer commented 5 years ago

Trying to do asynchronous operation (Action) when component loads ( mounted() ). State does not get properly updated. Using the counter example code:

// Does not work
public mounted() {
 store.increment();
}

// Works
public mounted() {
  setTimeout(() => {
    store.increment();
  }, 1);
}
ManuelSch commented 5 years ago

Thanks for the report. I'll take a look at the issue and let you know asap.