Premium
Local component state vs extracted composable for Vue feature logic
A Vue feature has search, selection, sorting, loading, and retry logic. Would you keep that state inside the component or extract it into a composable?
- Keep the state in the component
- Extract a composable
What you’ll build / What this tests
This premium vue tradeoff battle focuses on Local component state vs extracted composable for Vue feature logic. Commit to a direction, justify it with the prompt constraints, and explain when the alternative wins.
Learning goals
- Is the reuse real or only hypothetical?
- Can the composable expose one coherent API?
- How tied is the logic to one component's template and…
- How costly is duplication becoming?
Key decisions to discuss
- Pick a direction for this exact prompt, not the universal winner.
- State the trade-off that matters most for this scenario.
- Name when another option becomes the better answer.
- Keep the explanation grounded in concrete constraints.
Evaluation rubric
- Strong answers tie the recommendation to the prompt.
- Good tradeoff reasoning explains downsides, not just upsides.
- The answer should show when the recommendation stops being right.
- Follow-up pressure should not break the argument.
Constraints / Requirements
- Which direction would you defend for this prompt, and how would you explain when the other option is…
- Fits best when the logic is still truly local to one screen and extraction would mostly…
- Fits best when several screens share the same reactive workflow and the extracted API can stay…
Options on the table
Keep the state in the component: Fits best when the logic is still truly local to one screen and extraction…
Extract a composable: Fits best when several screens share the same reactive workflow and the extracted API…Common pitfalls
- Arguing from preference instead of prompt constraints.
- Pretending one option is always the winner.
- Ignoring the main downside of the chosen direction.
- Failing to explain when the alternative becomes stronger.
Related questions
Upgrade to FrontendAtlas Premium to access this tradeoff battle. Already upgraded? Sign in to continue.