Sent on Nov 22, 2023

Automatic reactivity with Vanilla JS

I want to share with you something that can potentially change the way you write Vanilla JavaScript today.

This something was inspired by Svelte — I got hooked by the way Svelte handles reactivity.

Just in case “reactivity” sounds like a huge terminology to you, it simply means: When something changes, something else should change (and be reflected in the DOM) at the same time.

Now this whole reactivity thing is much better explained with examples so reading today’s article would make much more sense immediately.

Two ways create reactivity in Vanilla JS

The two ways are:

  1. Getters and Setters
  2. JavaScript Proxies

Now, reactivity can sound complex. But I promise you that it sounds more complex than it actually is. Just check out today’s article and I’ll walk you through everything you need to know.

If there’s anything left unexplained, just let me know and I’ll try to supplement the information in a future article.

Hope this helps you level up your JavaScript game!

Stay awesome,
Zell

P.S. I’m planning to accept sponsorship for my articles and newsletters. Do you happen to know any companies who may be interested in sponsoring tech content like this?

If you do, or if you are familiar with how sponsorship works, please reach out to me! I appreciate it. Thank you!