View profile

Weekly Vue.js News - #44 - Debug Computed Properties

Michael Hoffmann
Michael Hoffmann
Hi ๐Ÿ‘‹
Three years ago I started my freelancing journey:
  • I worked for 3 projects in full-time
  • I increased my daily rate by +25%
  • I switched my focus from Angular to React to Vue
  • I regret nothing ๐Ÿ˜œ
In this issue, I show you how you can debug computed properties in Vue and how you can use type predicates in TypeScript to narrow down types.
Additionally, I published a new blog post about creating a Markdown file-base blog using Nuxt Content v2.
Have a great week โ˜€๏ธ

Vue Tip: Debug Computed Properties
We can debug computed properties by passing computed() a second options object with onTrack and onTrigger callbacks:
  • onTrack will be called when a reactive property or ref is tracked as a dependency.
  • onTrigger will be called when the watcher callback is triggered by the mutation of a dependency.
Both callbacks will receive debugger events in the same format as component debug hooks.
Keep in mind: onTrack and onTrigger computed options only work in development mode.
Vue News
Create a Blog With Nuxt Content v2
๐Ÿ“น Pinia: The Enjoyable Vue Store
๐Ÿ”ง Vitesse
TypeScript Tip: Use type predicates to narrow down types
Quote of the week
Did you enjoy this issue? Yes No
Michael Hoffmann
Michael Hoffmann @mokkapps

This weekly Vue newsletter gives you high-quality tips and curated content to help you become a Vue.js expert.

Additionally, it provides content about web development topics like TypeScript, JavaScript, HTML5, and CSS3.

Published each Monday since June 2021.

In order to unsubscribe, click here.
If you were forwarded this newsletter and you like it, you can subscribe here.
Created with Revue by Twitter.
Holzapfelkreuther StraรŸe 19, 81375 Munich, Germany