ngxs store dispatch actions are not called in the specific order

37 views Asked by At

I am using NGXS for store management and dispatching the following actions to update the store using the following syntax.

this.store.dispatch([
  new ChangeObjectActions.AddChange('modify', layoutName),
  new LayoutActions.SequenceChangeByDragDrop(
    layoutName,
    prevIndex,
    currentIndex
  ),
  new ChangeTransactionsInfoActions.UpdateChangeElementSequenceChange(
    this.changeElementSequenceSectionChangeService
      .getChangeElementSequenceChangeInfo(layoutName)
  ),
]);

ChangeTransactionsInfoActions.UpdateChangeElementSequenceChange is dependent on LayoutActions.SequenceChangeByDragDropenter code here (in this, we will update UI object which will be used in ChangeTransactionsInfoActions.UpdateChangeElementSequenceChange)

But as per the dispatched actions, I am expecting that the actions should be dispatched in the order maintained in the array but I see it not happening in my case.

I did not find any specific use case anywhere.

0

There are 0 answers