Javascript is required
Weekly Vue News Logo Weekly Vue News

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

Weekly Vue News - #56 - Avoid Side Effects in Computed Properties

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

Hi 👋

My code snippet tool is making good progress!

🤩 Every feature you see in the picture below will be part of the free version

🤩 Undo, Redo, Line Highlighting, blurring lines and many more

Stay tuned and have a great week ☀️

Vue Tip: Avoid Side Effects in Computed Properties

It is considered bad practice to introduce side effects inside computed properties and functions because it makes the code unpredictable and hard to understand.

What is a side effect? In the context of computed properties, a side effect is a modification of the state's global state or the internal component state.

Let's take a look at an example with side effects:

Now let's change the code and remove the side effects:

Read this fantastic article from Michael Thiessen for more details about side effects.

Curated Vue Content

📕 The 6 Levels of Reusability

👉🏻 Michael identified 6 different levels of reusability

⭐ Templating

⭐ Configuration

⭐ Adaptability

⭐ Inversion

⭐ Extension

⭐ Nesting

📕 Are you using Composition API the right way?

👉🏻 In this article, Roland explores why we should use Composition API and how to do it properly.

📕 Why you should be using Vue 3's Composition API

👉🏻 Andrew shows in this article three different components that were created in Vue 2, and then their counterparts replicated in Vue 3.

🛠️ Design the next iPhone

👉🏻 A pretty funny tool

👉🏻 Built with Nuxt.js

JavaScript Tip: Check Network Status

Curated Web Development Content

📕 The James Webb Space Telescope runs JavaScript

👉🏻 They use JS to control its Integrated Science Instrument Module

👉🏻 NASA calls that part “the heart of the Telescope”

📕 Advanced TypeScript Patterns: API Contracts

👉🏻 John explains an approach to writing pragmatic API contracts in TypeScript that eliminate an entire class of bugs.

📹 On the Future Features of JS

👉🏻 Hemanth is a TC39 delegate and hosts the popular TC39er podcast.

👉🏻 In this 25-minute talk, he flies through a variety of current language proposals, their progress, and why they matter.

🛠️ Create a miniature 3D city of your GitHub contributions

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 All rights reserved.