What are your favorite Vue.js best practices/design patterns?

vuejs
best-practices

#1

Personally, I love the practice of keeping API calls (where the response is stored in vuex) in vuex actions to be called by the component. Then I set the return of the action to be the (full) response from the API call so that the promise callback in the component can behave as if it’s actually just made the call itself. This has the added cleanliness benefit that now the component doesn’t have to concern itself with storing a variable in vuex, it just needs to call the appropriate vuex action, the return of which will always be the API response expected.

What are some of your favorites?


#2

Hello Ohheyitsbrian!

I have not used Vue, but I might know of someone who has…let me see what they have to say!

C