Spyke

Syndicated from the fediverse. Read and engage on the original instance.

View original on jlai.lu
vuejsยทVue.jsbylascapi

General architecture around Pinia to handle guards, interceptor and reactivity

Hi there, I'm working on a new app with Vuejs 3 and I wonder what are the good practice to architecture the app and to handle guards, JWT token refresh, reactivity and not having spaghetti code.

I started with the basic Vuetify app and added Pinia and the vue-router. ๐Ÿค 

One problem I want to solve is how to get the list to populate the first page with a list of objects, lets say a book list. Right now I created a store.books list and an action to call the API, according to the doc ( https://pinia.vuejs.org/core-concepts/actions.html ). But then I have to call the action when the user log in, or when the component is mounted, or when there is a refresh.

I found it not very DRY and just not smart, so I need some help and good doc to understand how to structure my app.

Thank you ๐Ÿ˜Œ

View original on jlai.lu
5

No replies yet

No comments on the original post yet.
General architecture around Pinia to handle guards, interceptor and reactivity | Spyke