Vue · Middle · Question 41 of 75
Can Pinia actions be asynchronous?
- ✓Correct answer: Yes, actions can be
asyncandawaitAPI calls while updating state - 2No, async logic must be in components
- 3Only with a special
asyncActionsplugin
Explanation
Unlike Vuex there are no separate mutations; actions change state directly. $onAction lets you observe actions, including when they resolve or fail.