is it possible to add "middleware" inside actions #1988
-
here's the case, i want to create function called withLoader, i want that the withLoader function is called everytime i access action in pinia
so everytime i make a store like this...
the someFetch function should be automatically execute the withLoader |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I already experimention with this code but the withLoader function doesnt get executed
|
Beta Was this translation helpful? Give feedback.
-
nvm, solved it |
Beta Was this translation helpful? Give feedback.
-
i just replace my withLoader function, and did this instead |
Beta Was this translation helpful? Give feedback.
i just replace my withLoader function, and did this instead
basically the onAction function trigerred everytime we call the action.
and the after function works after the action finish to execute