Optimizing State Management with Pinia in Nuxt.js #2683
-
Hello everyone, I'm currently working on a Nuxt.js application where I use Pinia for state management. My application involves handling various collections of todos with different filters, and I’m seeking advice on optimizing my current approach. Current Approach: Data Fetching and Storing: Data Retrieval: Todos to Do Older than One Week: Recently Finished Todos: Issue: Questions: Best regards, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Summary of my conversation with Likonima on Discord Dynamic Approach: API Calls: Minimal Use of Stores: Structuring: |
Beta Was this translation helpful? Give feedback.
Summary of my conversation with Likonima on Discord
https://discord.com/channels/325477692906536972/1248373498846384200
Dynamic Approach:
Prefer providing data directly via props to keep components dynamic.
API Calls:
Perform data fetches at the page level whenever possible, and use advanced caching mechanisms like Tanstack (caching de Nuxt) to optimize performance.
https://www.youtube.com/watch?v=aQPR0xn-MMk&ab_channel=AlexanderLichter
Minimal Use of Stores:
Minimize the use of stores to avoid unnecessary complexity and reduce bundle size.
Structuring:
Structure applications with data calls at the page level and distribute data via props or provide/inject to avoid cognitive overload and …