Tag

computed

0 views collected around this technical thread.

Code Mala Tang
Code Mala Tang
Oct 8, 2024 · Frontend Development

Avoid Spaghetti Code in Vue 3: When to Use watch vs computed

This article analyzes common misuse of Vue 3's watch for handling both synchronous and asynchronous updates, demonstrates how excessive watchers create spaghetti code, and shows how refactoring with computed can streamline logic, improve maintainability, and help new team members onboard faster.

VueWatchcode quality
0 likes · 7 min read
Avoid Spaghetti Code in Vue 3: When to Use watch vs computed
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Oct 2, 2024 · Frontend Development

Understanding Vue 3 ref, computed, and reactive: Definitions, Usage, and Best Practices

This article explains the purpose and internal implementation of Vue 3’s ref, computed, and reactive APIs, compares their behaviours in script and template contexts, discusses watch strategies, and offers practical guidelines for choosing and modularising these reactive primitives in large‑scale frontend projects.

ReactiveVue3Watch
0 likes · 16 min read
Understanding Vue 3 ref, computed, and reactive: Definitions, Usage, and Best Practices
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Oct 18, 2022 · Frontend Development

Implementing Vue 3 Computed API from Scratch

This article explains how to recreate Vue 3's computed API using the composition API, covering getter/setter handling, effect integration, caching with a dirty flag, dependency tracking, and trigger mechanisms, and provides step‑by‑step code examples to build a functional ComputedRef implementation.

Composition APIJavaScriptReactivity
0 likes · 10 min read
Implementing Vue 3 Computed API from Scratch