Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Vuex Quick Start Guide
  • Table Of Contents Toc
  • Feedback & Rating feedback
Vuex Quick Start Guide

Vuex Quick Start Guide

By : Koutifaris
3 (2)
close
close
Vuex Quick Start Guide

Vuex Quick Start Guide

3 (2)
By: Koutifaris

Overview of this book

State management preserves the state of controls in a user interface. Vuex is a state management tool for Vue.js that makes the architecture easier to understand, maintain and evolve. This book is the easiest way to get started with Vuex to improve your Vue.js application architecture and overall user experience. Our book begins by explaining the problem that Vuex solves, and how it helps your applications. You will learn about the Vuex core concepts, including the Vuex store, changing application state, carrying out asynchronous operations and persisting state changes, all with an eye to scalability. You will learn how to test Vuex elements and Vue components with the Karma and Jasmine testing frameworks. You will see this in the context of a testing first approach, following the fundamentals of Test Driven Development. TDD will help you to identify which components need testing and how to test them. You will build a full Vuex application by creating the application components and services, and persist the state. Vuex comes with a plugin system that allows programmers to extend Vuex features. You will learn about some of the most powerful plugins, and make use of the built-in logger plugin. You write a custom Google Analytics plugin to send actions to its analytics API, and an Undo/Redo plugin.
Table of Contents (8 chapters)
close
close

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...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY