Why do we need Actions if we can mutate the store directly from components / composition functions? #1276
Unanswered
martinszeltins
asked this question in
Help and Questions
Replies: 2 comments 1 reply
-
An action holds the business logic related to the store similar to methods in components |
Beta Was this translation helpful? Give feedback.
0 replies
-
@martinszeltins I am wondering exactly the same thing. One advantage I am currently experiencing in using composition functions over actions is that you can call other composition functions within your functions (for example UI success/error notifications), which I think you don't have access to within a store I'm curious to know what are the pros of using actions over composition functions. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
So with
Pinia
we can actually mutate the store directly from components or composition functions or from outside module. So what is the point of Actions now?I mean I can create those "action" functions outside of the store, right...? or am I missing something here?
Beta Was this translation helpful? Give feedback.
All reactions