As far as I understood, vuex mutations, which are synchronous, should not take too long to complete, in order to keep the vuex ready to get more mutations without overloading too much. Actions, on the other hand, might take longer to operate since they are async.
The question is, if I want to remove n elements from an array stored in the store, my best option would be to remove them one by one with multiple mutations, or just use a single mutatoin and complete it in O(n)?
I initially thought about creating a new list in the action, similar to the original but without the element I wanted to remove, and then use a mutation just to replace the original list with the new one, the problem is that since an action is async, the original list might change during the action and thus I might loose those changes.
Is there any best practice for this kind of situation? Thanks!