View profile

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

Michael Hoffmann (Mokkapps)
Michael Hoffmann (Mokkapps)
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 (Mokkapps)
Michael Hoffmann (Mokkapps) @mokkapps

Hi ๐Ÿ‘‹

My name is Michael Hoffmann and I'm a Senior Frontend Developer, Freelancer and Blogger.

I focus on Vue.js, JavaScript, TypeScript and Spring Boot. Occasionally I also give career & freelancer advice.

My weekly emails reflect this preference.

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