Javascript is required
Weekly Vue News Logo Weekly Vue News

Document is empty, overwrite this content with #empty slot in <ContentDoc>.

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

Migrated Issue
Expect missing links and broken styling, as this issue has been migrated from my previous newsletter service.

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 Create a Blog With Nuxt Content v2 mokkapps.de

In this article, I show you how to set up a simple Markdown file-based blog using Nuxt Content v2.

📹 Pinia: The Enjoyable Vue Store 📹 Pinia: The Enjoyable Vue Storevueschool.io

In this course, learn everything that you need to know to be proficient with Pinia as a state management solution in your Vue.js applications.

🔧 Vitesse 🔧 Vitessegithub.com

An absolutely amazing Vue + Vite starter packed with great developer experience:

👉 Components auto importing

👉 File-based routing

👉 Pinia for state management

👉 UnoCSS

👉 PWA

👉 and much more...

TypeScript Tip: Use type predicates to narrow down types

Quote of the week

Weekly Vue News LogoWeekly newsletter that gives you high-quality tips and curated content about Vue & Nuxt.
I will never share any of your personal data.
© 2023 weekly-vue.news. All rights reserved.