Vue · Senior · Question 1 of 75
How does Vue 3 track reactive dependencies?
- ✓Correct answer: Proxy
gettraps record the running effect as a subscriber (track);settraps notify subscribers (trigger) - 2It diffs the whole state object every frame
- 3It uses
Object.definePropertyon every property at creation, like Vue 2
Explanation
Effects (render functions, computed, watchers) register themselves while they run. Proxies also catch property addition/deletion and array index changes, which Vue 2's getters/setters could not.