Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Vuex Quick Start Guide

You're reading from   Vuex Quick Start Guide Centralized State Management for your Vue.js applications

Arrow left icon
Product type Paperback
Published in Apr 2018
Publisher Packt
ISBN-13 9781788999939
Length 152 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Andrea Koutifaris Andrea Koutifaris
Author Profile Icon Andrea Koutifaris
Andrea Koutifaris
Arrow right icon
View More author details
Toc

Vue.js reactivity system explained

One of the powerful features of Vue is its reactivity system. It is an unobtrusive way to detect changes to the components model. A component model is just a plain JavaScript object. When it changes, Vue detects the changes and updates the corresponding views. In Vuex, the single state tree is reactive, like the data part of a Vue component.

It is important to understand how the reactivity system works to avoid some common mistakes.

There are two ways to detect whether a value inside a JavaScript object has changed:

  • By using the Proxy feature, which is defined in ECMAScript 2015 (6th Edition, ECMA-262)
  • By using Object.defineProperty, which is defined in ECMAScript 2011 (5.1 Edition, ECMA-262)

For compatibility reasons, Vue decided to use Object.defineProperty, which means that there are some limitations.

When you create a component, Vue will...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime